# Rotate View Around Vector

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

## Recommended Posts

Hi

I've been trying to figure out how i can rotate my view around a vector. I have created this diagram:

Basically i have a 3d vector of X Y and Z called EYES. I create an offset of EYES lower down the y-axis.What i think i need to do is apply Yaw Pitch Roll rotation to the offset vector and then multiply it by the distance (120 units) which will result in the rotated vector, then calculate the dot product between the first vector and the end vector to rotate the view.

The part i am unsure of is how to get the resulting vector from the offset vector based on rotation. Could anyone help me?

Thanks,
Dan

##### Share on other sites
I'm not totally clear about what you are doing.

But it looks to me as though you are trying to rotate your eyes vector around the offset.

If this is the case then it's simply a matter of subtracting one vector position from the other ( eyes pos - offset pos : we'll call this distance : vec 3 x,y,z ), perform the rotation and then add distance back to eyes.

This moves your eyes vector so that it's relative to the origin and not the offset for the rotation.

KJM

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633690
• Total Posts
3013339
×