Grayscale Height Image -> .X mesh file?

Started by
5 comments, last by quantass 21 years, 7 months ago
Is there a util which can take a gray scale image and convert it to a DirectX .X mesh file (to create landscapes)?
Advertisement
Yes there is, and it''s quite good. - M R Ducs
LOL
cammon, dont be mean..

well, make one your self. Just read in all the heightmap data. Tesselate into triangles and save back into an X file. Or just dont use X files.


Its my duty, to please that booty ! - John Shaft
Actually there are several tools to do this. The best of which(IMHO) is TerGen. You can find two versions of it here:
http://www.petra.demon.co.uk/Games/index.html

-M R Ducs
Lead Programmer/Engine Programmer/Bug Maker
GDG
The thing that gets me is "how" to tesselate the heightmap data. Can you give me a little routine to do this?
well, there is ROAM. but thats a bit complicated for a newbie.
try this. I built one last time , but it drew quads, not triangles.


  int height(int x,int z){ // find the height and return it return map[x,z];}void draw(){for(int x=0,x < 1024;x += 32)for(int z=0;z < 1024;z += 32){   vertex(x,height(x,z),z);   vertex(x,height(x,z + 32),z + 32);   vertex(x + 32,height(x + 32,z + 32),z + 32);   vertex(x + 32,height(x + 32,z),z);}}  
;

of course i used opengl, but it would be quite easy to build one for d3d.

Its my duty, to please that booty ! - John Shaft

This topic is closed to new replies.

Advertisement