Jump to content
• Advertisement

# Floating above an environment

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

Hi there. Lets say I have an object on an environment at point (a). I also know the normal of the polygon the creature is currently on (n). What I want to do is move the creature from point (a) to an arbitrary position above the polygon, along the polygon's normal. How would I calculate point (b)? Previously I've just been adding a small amount to the y component of the object's position, but now my environments are very complex (for example a globe with mountains and cliffs), so obviously that technique is inadequate. Any help would be great! I expect the answer to be pretty simple, but my brain's frazzled.

#### Share this post

##### Share on other sites
Advertisement
I would think the answer to your question as stated would be b = a + amount*normal. However, I'm guessing that what you're really trying to do is more complicated than that...

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
41
2. 2
3. 3
4. 4
5. 5
• Advertisement

• 10
• 27
• 20
• 9
• 20
• ### Forum Statistics

• Total Topics
633404
• Total Posts
3011676
• ### Who's Online (See full list)

There are no registered users currently online

×

## 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!