Jump to content
  • Advertisement
Sign in to follow this  
Anddos

Map Editor Terrain Increase/Decrease

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

How do you select an area on the mesh to decrease on the y axis for the vertices like you see in map editors, you get like a small circle which represents the area that decrease's or increases.

Share this post


Link to post
Share on other sites
Advertisement

Your problem (which isn't overly complicated) has few phases to solve:

 

- find a ray starting from camera position and going to the direction pointed by the mouse (look for mouse picking ray casting on google)

- find intersection point of the ray from previous phase and the terrain

- get all vertices / height samples from a desired radius by using the intersection point from the last phase

- apply desired modify function to the height values (such as level terrain, add height, decrease height, blur ...). You may use the distance between the vertex and the intersection point as a blend value to smooth the modify function.

 

Cheers!

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!