VRML Import

Would it be possible to import VRML or other-formatted terrains into breve? I think this would be really great. If you have any advice, let me know . . .

VRML Import

You can load heightmaps (grayscale images), either by hand loading a PNG image and using pixel values coupled with a set-height for each elevation point in the mesh (my approach) or using the built-in heigthmap loading function, which reads TIFF files (easier, but I haven't tested it since I found out about it only after implementing the "by hand" method).

VRML Import

That is great that you can load TIFF's, but where is the built-in height map function? I looked for it under "terrain," but could not locate it. Is this like importing a GeoTIFF so the landscape is developed from the image?

VRML Import

See, that may explain why I didn't find out about it until after I implemented the "by hand" method: the method is not documented.

The name of the method is
load-geo-tiff from geoTIFFFile (string)

It is in the Terrain.tz file, but since it isn't documented it may not be ready for use or may have some bugs. I haven't tried it.

If it doesn't work, this is what I'm currently using for my simulation:

            heightMap = (new Image load from "heightmap.png").
            for x=0,x<100,x++:
                for y=0,y<100,y++:
                    floor set-height at-x (x*0.66) at-y (y*0.66) to (heightMap get-green-pixel at-x x at-y (99 - y))*10.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.