Jump to content
  • Advertisement
Sign in to follow this  
gatofedorento

OpenGL Draw a circle on a terrain

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

Hey there,

I'm making some tools to edit a terrain in real time, I used UDK and cryengine3 SDK once and i really liked the idea of a circle being projected into a terrain so you could see the parts of the terrain that will be elevated, something like this:

http://www.google.pt/imgres?q=circle+on+terrain+editing&um=1&hl=pt-PT&biw=1280&bih=675&tbm=isch&tbnid=9jVdXzohVWrFIM:&imgrefurl=http://docs.garagegames.com/torque-3d/official/content/documentation/World%2520Editor/Editors/ForestEditor.html&docid=U2LlLEi1pN5bJM&imgurl=http://docs.garagegames.com/torque-3d/official/content/documentation/World%252520Editor/Editors/images/FEBrushCircle.jpg&w=640&h=495&ei=F3mxTsCqCs_W8QPG5oCfAQ&zoom=1&iact=hc&vpx=372&vpy=179&dur=264&hovh=197&hovw=255&tx=181&ty=118&sig=116131322825815505119&page=2&tbnh=138&tbnw=174&start=15&ndsp=18&ved=1t:429,r:13,s:15

So i was thinking in a good way to do this, but I want some opinions...

First of all, my terrain is a mesh maded of triangles, so the idea was:
-Find the coordinate my mouse is pointing at, I was thinking of try to pick the triangles and check if I picked any of them, if i do i could read his coordinates with an openGL function
-After that I should find some adjacent triangles and check if some of their coordinates are still inside my circle, if they are I could calculate some coordinates from my circle to draw it

I believe there are better ways to do this, if that's true I would like to read some feedback, thank you.

Share this post


Link to post
Share on other sites
Advertisement
Use decals, for example -> http://blog.wolfire.com/2009/06/how-to-project-decals/

Just google for decals or search the forums and you'll find lots of resources.

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!