Advertisement Jump to content
Sign in to follow this  
s_akhtar

Height Map from Mesh

This topic is 4897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
There is a way...one solution would be to find what height the terrain/mesh is at a certain point, then simply output this to a file.

Share this post


Link to post
Share on other sites
Just render an orto-view of the mesh from above and save the depthbuffer to an image-file. There is your heightmap!!

/Mike

Share this post


Link to post
Share on other sites
I haven't tried it, but it could work like this (after switching to top view ortho mode)


float pixels[<screenwidth>][<screenheight>];
glReadPixels(0,0,<screenwidth>,<screenheight>,GL_DEPTH_COMPONENT,GL_FLOAT,&pixels);



If that works, it would be enough information to build up a grayscale image file.

Greets

Chris

Share this post


Link to post
Share on other sites

This topic is 4897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!