• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Convex or concave?

This topic is 5844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, how can i find out if a terrain surface is convex or concave in order to get the exposure to wind and weather. Thanks alot. - Stephan
OpenMountains | Open source snowboard simulation - some day.

##### Share on other sites
If it is a mesh then you would check whether the normals point towards or away from one another. The cross product of an edge and the normal gives you a vector which you can use in a dot product with the other normal to make that determination. At the actual vertices I''m not sure what the appropriate thing would be.

If it is a conteneous surface, i.e. z=f(x,y) or r(s,t)=(x(s,t),y(s,t),z(s,t)) then I think you have to choose a direction. With z=f(x,y) then (0,0,1) would be a natural choice for direction. With r(s,t) then it would be dot product of the direction with the cross product of the second derivatives with respect to s and t. That is basically equivalent to the second derivative test. I can''t swear that is correct through. I would suggest trying a few reasonableness tests. If you use a parametric equation of the form r(s,t)=(s,t,z(s,t)) then you can color map z of the function and the second derivative to create a bitmap. You should be able to compare the two bitmaps and see if it is reasonable.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634131
• Total Posts
3015726
×