Terrain Angle Check.

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

Recommended Posts

Hi there, I have an question about checking if an point is more then 60+ degrees lyeing on an 3dterrain, if so return true or else false. I will try to use this for my game so I can't clamb high mountain/hills. Any solutions how to do this? Thanks.

Share on other sites
Find the normal of the terrain under that point.

Then check if

n.y / sqrt(n.x^2 + n.z^2) > tan60

Basically that is the tangent of the angle of the normal with the horizontal.

Share on other sites
Notice that a point is not going to have a direction on a terrain. You can allways look at it from a lot of diffrent directions giveing it a diffrent angle.

What you need is where the character is and where he is trying to go; a point and a direction. Then you can add the length of the movment to the point and find out what that height will be at that point. Useing the two heights you can find out what the angle is.

1. 1
2. 2
3. 3
4. 4
Rutin
11
5. 5

• 12
• 19
• 10
• 14
• 10
• Forum Statistics

• Total Topics
632665
• Total Posts
3007717
• Who's Online (See full list)

There are no registered users currently online

×