Using the Nmtools package

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #21by t00fri » 30.12.2006, 13:58

Christophe wrote:Congratulations to the CM team for the launch of the site. It was long in coming, but it was worth the wait!

I find the nmtools tutorial very good, it should be achievable by any interested and motivated user. However I fear I was quite right when, while testing the tools, I wrote to Fridger:
A GUI would be a nice addition too, as you mentioned yourself windows and mac users are not familiar with the command line and I'm sure many will not even bother with a non graphical application.

of course I find it sad that in our world of shiny clicky GUIs people are so easily rebuted when interactions require reading and writing, but it's a fact of life...

Anyway, now that the code is out, it's up to any interested developer to add a shiny GUI to these ugly evilish command line utilities.

And remember that in the beginning... was the command line.


Thanks for the compliments, Christophe!

As to a GUI, fact is that the Linux guys need a GUI least since many of them are accustomed to console operations to some extent. On the other hand, I am sure you are able to code a GUI for Linux (KDE) very quickly.

Yet what is needed is actually a GUI for Windows ENDUSERS ;-) , since these seem to be largely unaware, how to even activate the console... According to Daniel's "ENDUSER" definitions above, Windows ENDUSERS are also entirely unwilling to learn anything new.

What always induces some flow of adrenaline in my system ;-) are the natural expectations of so-called "ENDUSERS" (<- danielj) : People like us are supposed to spend lots of their time to spare THEM reading a manual or learning a few new things in a comparatively SHORT time...

Bye Fridger
Image

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #22by Fightspit » 30.12.2006, 14:04

I prefer use the term PLUG&PLAYUSER, it is more appropriate for him, you know :wink:
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 3 months
Location: Lyon (France)

Post #23by Christophe » 30.12.2006, 15:46

You know Fridger this kind of behaviour is starting to show up in the linux user community too. Ubuntu is now fully point & click compliant if your hadware happen to be supported.

Anyway, Qt4 is available under the GPL for the three platforms. Writting a GUI for the nmtools with it, along with my suggested optimization shouldn't take more than 5 man days. Now, as I said before, I'm not sure it is worth spending time on this considering these tools aren't meant to be used on a day to day basis. Plus, having to think and understand what's going on to use a tool should be considered a feature ;-)
Christophe

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #24by t00fri » 30.12.2006, 19:47

Christophe wrote:You know Fridger this kind of behaviour is starting to show up in the linux user community too. Ubuntu is now fully point & click compliant if your hadware happen to be supported.

Anyway, Qt4 is available under the GPL for the three platforms. Writting a GUI for the nmtools with it, along with my suggested optimization shouldn't take more than 5 man days. Now, as I said before, I'm not sure it is worth spending time on this considering these tools aren't meant to be used on a day to day basis. Plus, having to think and understand what's going on to use a tool should be considered a feature ;-)


D'accord 100%!

Cheers,
Fridger
Image

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #25by tech2000 » 31.12.2006, 20:39

Can anyone point me in the right direction for getting a nice base texture.

I was looking for anything among these: http://snowy.arsc.alaska.edu/nasa/

I have tried this: http://snowy.arsc.alaska.edu/nasa/bmng/ ... 200.bin.gz

But the result was not what I was hoping for... :cry:
I cut the texture with nmtools just like I did with the normalmap texture which by the way looks awesome. (I can still see tyhe shadows though.)

But since the files @ NASA is, well enormous to use one word, I would like to know which base texture I should use? It sux downloading for a day just to see it wasn't the right file. :cry:

Thanks in advance, Anders

PS. Can someone confirm my ssc & ctx files content?

This is the SSC.

Code: Select all

AltSurface "Blue Marble" "Sol/Earth"
   {
   Texture "Blue Marble.ctx"
   NormalMap "BM Normal.ctx"
   }


This is Blue Marble.ctx.

Code: Select all

VirtualTexture
  {
        ImageDirectory "BMNG Texture"
        BaseSplit 0
        TileSize 1024
        TileType "png"
  }

This is MB Normal.ctx.

Code: Select all

VirtualTexture
  {
        ImageDirectory "BM Normal"
        BaseSplit 0
        TileSize 1024
        TileType "png"
  }

And ofcourse the directories are called "Blue Marble" & "BM Normal"

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #26by Fightspit » 31.12.2006, 21:01

tech2000 wrote:I cut the texture with nmtools just like I did with the normalmap texture which by the way looks awesome. (I can still see tyhe shadows though.)


You can't use the nmtool with the base texture.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #27by tech2000 » 31.12.2006, 21:38

Fightspit wrote:
tech2000 wrote:I cut the texture with nmtools just like I did with the normalmap texture which by the way looks awesome. (I can still see tyhe shadows though.)

You can't use the nmtool with the base texture.


Okay, thanks for that info... Then could some nice person explain how to add the base texture? It needs to be cutted into tiles the same way as the normalmaps, right?

Bye, and happy new year... Anders (El ??ltimo vikingo) Pamdal

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #28by Fightspit » 31.12.2006, 22:10

There is not yet an "official" tool like the nmtool for the base texture but I am not sure if Fridger is making it. Otherwise, I have a tool to do VT base texture but I can't give you unless you can contact RVS (autor of this tool) by PM (Private Message) if you want to use this tool.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #29by tech2000 » 31.12.2006, 22:29

Fightspit wrote:There is not yet an "official" tool like the nmtool for the base texture but I am not sure if Fridger is making it. Otherwise, I have a tool to do VT base texture but I can't give you unless you can contact RVS (autor of this tool) by PM (Private Message) if you want to use this tool.


Okay, thanks for the info...

Fridger: do you by any chance have anything hidden in your sleeves :wink: or do you have anything planned regarding this?

I think that that would complete the nmtools suite... :wink:

Anyhow, thanks for all... Cheers, Vikingo

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Newbie question

Post #30by danielj » 02.01.2007, 19:43

Ok,now I am trying.I opened the console,typed nms and unzipped the nmtools and the test raw elevation data.But I have a very Newbie question.Sorry for that...how can I change the directory?
My elevation data is in C:\Program Files\nmtools-1.01\Win32_PC.bin,but in the console is C:\Documents and Settings\User.
I try to write the new directory IN FRONT of the latter and didn??t work.Can you help me?


t00fri wrote:
Christophe wrote:You know Fridger this kind of behaviour is starting to show up in the linux user community too. Ubuntu is now fully point & click compliant if your hadware happen to be supported.

Anyway, Qt4 is available under the GPL for the three platforms. Writting a GUI for the nmtools with it, along with my suggested optimization shouldn't take more than 5 man days. Now, as I said before, I'm not sure it is worth spending time on this considering these tools aren't meant to be used on a day to day basis. Plus, having to think and understand what's going on to use a tool should be considered a feature ;-)

D'accord 100%!

Cheers,
Fridger

Fightspit
Posts: 510
Joined: 15.05.2005
With us: 19 years 6 months

Post #31by Fightspit » 02.01.2007, 20:17

In DOS, to change directory is :

Code: Select all

cd yourfolder

Exemple: you are at C:\Documents and Settings\User and you want go to My Document, you just type:

Code: Select all

cd "My Document"


Note: If your folder name has a space, you must put a "..."

Also, instead of doing several cd you can put a \ after your folder like this:

Code: Select all

cd "My Document\folder1\folder2\...\folder26" and so on...


And more, you can press several time on tab (tabulation) after typing cd to chose several folder that you can go to.
Motherboard: Intel D975XBX2
Processor: Intel Core2 E6700 @ 3Ghz
Ram: Corsair 2 x 1GB DDR2 PC6400
Video Card: Nvidia GeForce 8800 GTX 768MB GDDR3 384 bits PCI-Express 16x
HDD: Western Digital Raptor 150GB 10000 rpm
OS: Windows Vista Business 32 bits

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

re

Post #32by John Van Vliet » 02.01.2007, 22:17

hi i found a possible bug in nms tool
well a hack of it to enable the use of 16 bit unsined images

Code: Select all

float readS16(FILE *in)
{
    long b2;
   
    fread(&b2, 2, 1, in);

    if (byteSwap == 1)
       
        b2 = (32767-((b2 & 0xff00) >> 8)) | (32767-((b2 & 0x00ff) << 8));
    return (long) b2;


at 4k there is a 3 pixle shift to the right and for an 8k map there is a 32 pixle shift to the right

i compared normalmaps made in nm16 and nmsu( unsined) hack after seeing the offset in celestia for Venus
ps. ImageMagick-6.3.0 is still broken for converting unsined to sined and msb to lsb

danielj
Posts: 1477
Joined: 15.08.2003
With us: 21 years 3 months

Post #33by danielj » 02.01.2007, 22:28

Thanks,but there is a NEW problem.
I can??t use the Pipe mecanism because I don??t have a vertical bar in my keyboard.What to do now?


Fightspit wrote:In DOS, to change directory is :

Code: Select all

cd yourfolder

Exemple: you are at C:\Documents and Settings\User and you want go to My Document, you just type:

Code: Select all

cd "My Document"


Note: If your folder name has a space, you must put a "..."

Also, instead of doing several cd you can put a \ after your folder like this:

Code: Select all

cd "My Document\folder1\folder2\...\folder26" and so on...


And more, you can press several time on tab (tabulation) after typing cd to chose several folder that you can go to.

Johaen
Posts: 341
Joined: 14.01.2006
With us: 18 years 10 months
Location: IL, USA

Post #34by Johaen » 02.01.2007, 23:15

danielj wrote:Thanks,but there is a NEW problem.
I can??t use the Pipe mecanism because I don??t have a vertical bar in my keyboard.What to do now?


Copy, Paste.
AMD Athlon X2 4400+; 2GB OCZ Platinum RAM; 320GB SATA HDD; NVidia EVGA GeForce 7900GT KO, PCI-e, 512MB, ForceWare ver. 163.71; Razer Barracuda AC-1 7.1 Gaming Soundcard; Abit AN8 32X motherboard; 600 watt Kingwin Mach1 PSU; Windows XP Media Center SP2;

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Post #35by ajtribick » 02.01.2007, 23:32

Johaen wrote:
danielj wrote:Thanks,but there is a NEW problem.
I can??t use the Pipe mecanism because I don??t have a vertical bar in my keyboard.What to do now?

Copy, Paste.


That wouldn't work on the command line. At least, it doesn't in my version of Windows.

To get vertical bar, make sure NUM LOCK is on, hold down ALT and type 124 on the numeric keypad. Then release the ALT key.

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

re

Post #36by John Van Vliet » 03.01.2007, 00:02

hi danielj the botton next to the " shift" and over the" control / ctol "botton
and the ALT and type 124 should work in windows
also you might want to install windows power toys , one of them is "open cmd window hear "
from the right click menue ( on a folder)select "open cmd hear " and it will open in thet folder
a link
http://www.microsoft.com/windowsxp/down ... rtoys.mspx

tech2000
Posts: 258
Joined: 14.02.2006
Age: 52
With us: 18 years 9 months
Location: Skepplanda, Sweden

Post #37by tech2000 » 03.01.2007, 00:22

chaos syndrome wrote:
Johaen wrote:
danielj wrote:Thanks,but there is a NEW problem.
I can??t use the Pipe mecanism because I don??t have a vertical bar in my keyboard.What to do now?

Copy, Paste.

That wouldn't work on the command line. At least, it doesn't in my version of Windows.

To get vertical bar, make sure NUM LOCK is on, hold down ALT and type 124 on the numeric keypad. Then release the ALT key.


It does work to copy and pase in Windows CLI too... Just copy the line with ctrl+c and paste it by rightclick the CLI window and chose paste.. :wink: It's just the shortcut ctrl+v that doesn't work ... Atleast Windows XP and Windows Vista, I don't remember how is was before XP... sorry.. that was along time ago :wink:

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #38by t00fri » 03.01.2007, 00:47

Daniel,

I am horrified: who buys a keyboard without a | key? (you apparently ;-) )

The | is a VERY frequent key in any kind of programming independent of the used operating system. So whoever sold you that keyboard, how could he have known that you never write programs?

Are you really sure that the | is missing on your keyboard? In my US English keyboard the | is on top of the \ key. What's over the \ key in your keyboard?

Is Daniel the only one without a | key?

The | is not only the pipe operator, but also in C/C++, there is

Code: Select all

 x | y              x bitwise ORed with y
 x | = y          assign  x | y to x
||                   logical OR


similarly in PERL, FORTRAN, MAPLE/LUA ... various other Programming languages that I know. Hence a keyboard without a | key is NOT a sensible keyboard for computer work.

Bye Fridger
Last edited by t00fri on 03.01.2007, 01:37, edited 2 times in total.
Image

Avatar
Topic author
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Re: re

Post #39by t00fri » 03.01.2007, 01:30

john Van Vliet wrote:hi i found a possible bug in nms tool
well a hack of it to enable the use of 16 bit unsined images

Code: Select all

float readS16(FILE *in)
{
    long b2;
   
    fread(&b2, 2, 1, in);

    if (byteSwap == 1)
       
        b2 = (32767-((b2 & 0xff00) >> 8)) | (32767-((b2 & 0x00ff) << 8));
    return (long) b2;


at 4k there is a 3 pixle shift to the right and for an 8k map there is a 32 pixle shift to the right

i compared normalmaps made in nm16 and nmsu( unsined) hack after seeing the offset in celestia for Venus
ps. ImageMagick-6.3.0 is still broken for converting unsined to sined and msb to lsb

John,

I first have to understand /precisely/ what you WANT to say: Are you really claiming that the normalmaps generated with nms, without using any conversion via ImageMagick (!) anywhere in the chain, generates such large pixel shifts of 3 and 32 pixels, respectively?

That I would find hard to believe, since there were many tests , really.

But if you did use 'convert' of IM anywhere, then everything is possible, since IM has MANY bugs, unfortunately. I have observed a number of odd pixel shifts and related artefacts while still using 'convert' from IM. But these were from 'convert' NOT from the nmtools!

My respective codelines for a byteswap in readS16(FILE *in) were

Code: Select all

    if (byteSwap == 1)
       b2 = ((b2 & 0xff00) >> 8) | ((b2 & 0x00ff) << 8);
   
    return (short) b2;


Since the output must be a signed short int (-32768...32768) not a long one, my code does what it is supposed to do: it just flips the 2 Bytes . That cannot possibly generate such odd pixel shifts as you seem to observe. Such high shifts in an 8k normalmap would have produced HORRIBLE mismatches with the base texture which would certainly have been spotted in the tests.


Bye Fridger

PS: Thanks for using also "Fridgers Column" in CM. I get any news there right away via a RSS target. Actually, one has to use HTML formatting in there for paragraphs etc, which is quite similar to what we also do here.

e.g.

bold <b> ......</b>
italic <i> ......</i>
paragraph (break) <br>, hence a 1 line spacing is obtained via <br><br>
Image

Avatar
John Van Vliet
Posts: 2944
Joined: 28.08.2002
With us: 22 years 2 months

re

Post #40by John Van Vliet » 03.01.2007, 07:13

well tonight i took a very close look at the code ( nms) and i have to agree with you im must , by defoult, be the culprit . I am still working on it ,but in the end i am betting that it is im is the problem

if i have the time i will look into doing a raw/ gray/img plugin / output for nip2
should be very easy just saving the .v format without the 58 bit headder
that way i can get away from im


Return to “Celestia Users”