Jump to content
  • Advertisement
Sign in to follow this  
tbecker82

OpenGL Overlaying a texture on a height map for terrain

This topic is 4231 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

I'm pretty new to openGL so please bear with me. I couldn't find an existing thread that answered my question so I started this one. Ive got a bmp that I created that corresponds to another bmp that respresents a height map. The first bmp is an image that I would like to entirely drape over the terrain that gets created. I have not been able to figure out how to do this All I've been able to accomplish is placing the bmp image on all the individual quads that make up the height map, so I see a million copies of my bmp for my terrain. If anyone has some code snippets or a good article that they could point me to, I would appreciate it. Thanks

Share this post


Link to post
Share on other sites
Advertisement
You could read the color of the pixel of the first image and vertex color the quad.

Another option ( better to do if you have each quad has 1+ pixels ), is calculate the texture coordinate of the pixel.

Share this post


Link to post
Share on other sites
Maybe my basic tutorial on terrain rendering could help you. You find it at
http://www.freaksolutions.com/pcorner/index.php?action=tutorials&subact=view&id=4

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!