Archived

This topic is now archived and is closed to further replies.

quantass

Grayscale Height Image -> .X mesh file?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites