Jump to content
  • Advertisement
Sign in to follow this  
g3m0r

OpenGL terrain draw circle

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

Hello,

I have a problem, I want to make a terrain editor.

Now I want a circle on the terrain as brush for gaining terrain height on a specific area or for paint texture.

How can I code this, with OpenGL 1 (without Shading Language) so that every computer with opengl can run that?
Do you know a terrain-application with source-code where I can look?


best regards,
g3m0r

Share this post


Link to post
Share on other sites
Advertisement
Supposing you have the point where your mouse intersects the terrain, you could get the distance from each of the terrain's vertices to your mouse point. For each vertex, if the distance is below the radius of your circle, set the vertex color to the highlight color.

That's how I do it, granted I use per pixel rather than per vertex.

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!