Jump to content
  • Advertisement
Sign in to follow this  
s_akhtar

Height Map from Mesh

This topic is 4828 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 4828 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!