Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Map Editor Terrain Increase/Decrease

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Anddos   Members   

588
Like
0Likes
Like

Posted 11 May 2014 - 12:03 PM

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.


:)

#2 kauna   Members   

2922
Like
2Likes
Like

Posted 11 May 2014 - 06:09 PM

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!






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.