Jump to content
  • Advertisement
Sign in to follow this  
s_akhtar

Height Map from Mesh

This topic is 4835 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
hi, this might not work, never tried this before but you could sample the mesh unit by unit (meter by meter or whatever)...say you have a mesh that would fit a 256x256 heightmap, starting from a corner generate 256x256 perpendicular rays starting from y=0 (or below if needed) and do a ray intersection test with the mesh, then you'll know the height of the mesh in that point. Because you will lose some of the details you could try casting more rays with a shorter increment and interpolate the values.

Although I doubt that you'll get a perfect image of the mesh with this method, hope this helps somehow.

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 hightmap!

/Mike

Share this post


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

/Mike


Now that is just cheating...albeit its a hell of a lot simpler sounding than what I suggested.

Edit: Ok, maybe I forgot to click the post button when I replied to this...

Share this post


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