Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Heightmap2Volume
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=26
Page 1 of 1

Author:  joschka12 [ Mon Mar 09, 2009 9:32 am ]
Post subject:  Heightmap2Volume

Hello,

pleased seeing the Heighmap2Volume converter, I wanted to try it.

My approach:
1.) backup ..\thermite\share\thermite\Ogre\volumes\terrain.volume
2.) do any snap shot of the media player sound battery
3.) store it as jpg 512*512 (should be a power of 2) or is here the +/-1 issue?
4.) start a dos prompt
5.) naviagate to \thermite\bin
6.) start heightmap2Volume
7.) copy the created volume to the folder (see 1)
8.) start thermite again

Well it did not work.

I could not create the new terrain.volume.
Here is what happend in the dos promt:

---------------------------------------------
Thermite Heightmap to Volume Converter

Usage: Heightmap2Volume -i [file] -o [file] -u [0-255] -s [0-255] -t [1-10]

-i The name of the image file. This arguent is required
Images dimensions must be a power of two.
Suppored formats include .bmp, .gif, .jpg/jpeg, .png,
.pbm, .pgm, .ppm, .tiff, .xbm and .xpm.
-o The name of the volume file to write to disk.
This defaults to "output.volume"
-u The material ID to use for voxels underneath the heightmap.
This defaults to '1'
-s The material ID to use for voxels on the surface of the heightmap.
This defaults to '2'
-t The desired thickness of the surface in voxels.
This defaults to '5'


C:\Documents and Settings\Administrator\Desktop\thermite\bin>heightmap2Volume.ex
e -i myheightmap.jpg -o terrain.volume -u 1 -s 2 -t 5
ERROR: Failed to open input image myheightmap.jpg

C:\Documents and Settings\Administrator\Desktop\thermite\bin>

-------------------------------

The file myheightmap.jpg was copied in the \thermite\bin folder
Do I need to reduce colors to gray values?
Or is there another issue?

Your kind support is appreciated.
Cheers

Author:  joschka12 [ Mon Mar 09, 2009 10:34 am ]
Post subject:  Re: Heightmap2Volume

My second attempt was doing the image just using gray values.
The same result

Cheers

Author:  milliams [ Mon Mar 09, 2009 12:02 pm ]
Post subject:  Re: Heightmap2Volume

I can't be sure but my first guess would be that either Qt or Heightmap2Volume was built without jpg support. As a test, try saving it is a gif, png or bmp instead.

Also, I believe that for now Heightmap2Volume only supports 256x256 heightmaps though this limitation should be lifted some time soon.

Author:  joschka12 [ Mon Mar 09, 2009 1:55 pm ]
Post subject:  Re: Heightmap2Volume

Thank you for your kind reply containing the hints I needed.

1.) Limited the image to 256 * 256 dots just gray scale
2.) Conversion to JPG and GIF did not result in any difference
3.) Conversion to PNG or BMP caused a different behaviour. (please find attached the error message).
4.) Nevertheless terrain file was created
5.) copied the terrain.volume to the target directory
6.) Started Thermite and it worked!!!!

Open issues:
Error Message
No Textures
Canon not visible
Terrain floats over the Water

This already looks promising
Thanks
Cheers

Attachments:
File comment: Error message calling Heightmap2Volume using a 256 * 256 gray scale picture file.
Error Heighmap2Volume 001.jpg
Error Heighmap2Volume 001.jpg [ 102.98 KiB | Viewed 5754 times ]

Author:  joschka12 [ Mon Mar 09, 2009 1:57 pm ]
Post subject:  Re: Heightmap2Volume

And just for completeness. Please find hereby the screenshot of the successfully loaded new terrain.volume.
Cheers
J

Attachments:
Floating Landscape.jpg
Floating Landscape.jpg [ 107.45 KiB | Viewed 5754 times ]

Author:  milliams [ Mon Mar 09, 2009 3:02 pm ]
Post subject:  Re: Heightmap2Volume

I can't reproduce that Heightmap2Volume error on my Linux box. Could you attach the exact myheightmap.png you used to produce the error message?

Author:  joschka12 [ Mon Mar 09, 2009 3:21 pm ]
Post subject:  Re: Heightmap2Volume

Thanks again for your kind attention.
I have discarded the original file, but I could easily reproduce the same behaviour with any other image. I did a quick sketch on Inkscrape and converted it by Irfanview to a 256*256 gray scale png.

There is another funny thing. So I add a new screen shot. The shell creates bubbles instead of wholes if it hits "air"

Cheers
J

Attachments:
myheightmap.png
myheightmap.png [ 16.94 KiB | Viewed 5750 times ]

Author:  joschka12 [ Mon Mar 09, 2009 3:23 pm ]
Post subject:  Re: Heightmap2Volume

here comes the second image.

Attachments:
BubblesOfRock.png
BubblesOfRock.png [ 252.25 KiB | Viewed 5748 times ]

Author:  milliams [ Mon Mar 09, 2009 4:21 pm ]
Post subject:  Re: Heightmap2Volume

Okay, so I can reproduce the error with the file you provided. It's strange that a different file can cause a crash like that but never mind. Dave, here's the GDB output I get from it:
Code:
#0  0x00007ffff36e46bc in ?? () from /lib64/libc.so.6
#1  0x00007ffff36e5467 in ?? () from /lib64/libc.so.6
#2  0x00007ffff36db178 in open_memstream () from /lib64/libc.so.6
#3  0x00007ffff373d618 in __vsyslog_chk () from /lib64/libc.so.6
#4  0x00007ffff36dc889 in ?? () from /lib64/libc.so.6
#5  0x00007ffff36e2118 in ?? () from /lib64/libc.so.6
#6  0x000000000040465b in ~BlockVolume (this=0x7fffffffd7f0)
    at /home/matt/root/include/PolyVoxCore/BlockVolume.inl:84
#7  0x0000000000404327 in main (argc=11, argv=<value optimized out>)
    at /home/matt/thermite/Heightmap2Volume/source/main.cpp:209

It seems to be crashing on exit while trying to destroy the BlockVolume volData.

Author:  David Williams [ Mon Mar 09, 2009 8:02 pm ]
Post subject:  Re: Heightmap2Volume

Ok, various issues here to work through...

It does seem like there is a problem loading .JPG's, I guess I must have not enabled JPG support when I built Qt. But as long as other formats work I won't worry about this too much for the time being.

The error message when the converter finishes is a known problem which I also get on my machine. Actually the eror comes from PolyVox - somewhere the memory is not being deleted properly. I will look into this but at least it makes the volume :-)

For the missing textures see my other post: viewtopic.php?f=2&t=25

You say the cannon is not visible - that is strange. Are you sure it's not just underground? Can you see it with the original terrain? If not, how were you able to fire shells?

The height of the water can be adjusted but the water is not actually part of the volume (it's just a mesh). If you open 'share\thermite\Ogre\maps' you will find 'load_me.map' This is the XML file which is loaded when you run the engine. You can change the volume which is loaded in here, and you can also move the water:

Code:
<node name="Water">
         <scale x="126" y="126" z="1" />
         <position x="127.5" y="20" z="127.5" />   
         <rotation qw="0.707" qx="-0.707" qy="0" qz="0"/>               
         <entity meshFile="water.mesh" name="WaterMesh" castShadows="True" collisionShape="exact" mass="0.0"/>
      </node>


Try changing y="20" to a bigger number.

I believe the 'bubbles' problem is because the cannon is actually underground. So as soon as you fire the cannon the shell explodes. Also the camera is 'inside' the ground which doesn't make sense... try placing the camera inside a bubble and firing some more. You might see what I mean...

Unfortunatly there is currently no way to change the position of the cannon. Eventually it will be controlled by the XML file, but not yet...

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/