Jump to content
  • Advertisement
Sign in to follow this  
Kazade

OpenGL Highlighting part of a heightmap

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

Hi guys, Im writing an OpenGL based terrain editor in which I have a landscape generated. What I want to do is draw a blended red circle over the terrain based around the position of the mouse. So the circle will follow the cursor across the terrain colouring it red as it goes. I need some advice on how to do this, I was just going to render the heightmap again with a circle texture at the mouse position, but this is costly. Can anyone think of a better way? Cheers. Luke.

Share this post


Link to post
Share on other sites
Advertisement
you could create a NxN batch of quads/triangles whatever

apply a red circle texture and transform the texture coordinates when moving the mouse
and update the NxN batch so when you reach the next row/colum of your terrain you need to update the positions of the vertices


use alpha blending and render the circle after you rendered the terrain

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!