Advertisement Jump to content
Sign in to follow this  
Kazade

OpenGL Highlighting part of a heightmap

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

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!