# stupid vector question

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

## 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 on other sites
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 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 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 on other sites
yeah but how do i do that

##### Share on other sites
i'm sorry i'm an idiot i figured it out. thanks for the help

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

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632999
• Total Posts
3009814
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

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!