Jump to content
  • Advertisement
Sign in to follow this  
scottrick49

stupid vector question

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

I have two vectors. The first represents the forward vector. The second represents the velocity vector which is relative to the forward vector. I am drawing a blank on how to calculate the actual direction vector where I would be moving. Can anybody help?

Share this post


Link to post
Share on other sites
Advertisement
Hi!

Why do you have the velocity vector relative to the forward vector? And what do you exactly mean by "relative"?

The point in having a velocity vector is that it stores the direction in which you're moving.

Share this post


Link to post
Share on other sites
the forward vector represents which way the character is looking
the velocity vector represents which direction the character is moving

so if the velocity is backwards, the character is walking backwards from where he is looking.

the velocity vector does store the direction you are moving, but its relative to the direction you are looking.

Share this post


Link to post
Share on other sites
You can just rotate the velocity vector the same way as the forward vector when looking around. That way it will stay relative to the forward vector.

Share this post


Link to post
Share on other sites
For rotating a vector you basically have 3 options:

1. Construct a rotation matrix and multiply your vector with this matrix
2. Use euler angles
3. Use quaternion rotation

Google can give you plenty of resources on each of these methods.

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!