Jump to content
• Advertisement

# 3rd person chase-cam orientation

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

Right now im working on a project that is comparable to a flight simulator with a 3rd person chase camera. Both the jet and the camera are represented by 4x4 matrices--the camera still uses world coordinates in this form, I take the inverse before applying it as a transform later. Each frame, I update the orientation and the position of the jet based on input, and then I have to update the camera accordingly. First I find the direction the camera should point (basically, the negative Z axis), by subtracting the camera's position vector from the jet's position vector, and then scaling it to one by dividing by the distance--no problem. Then I update the position of the camera by simply moving it along this new Z axis, to the desired distance from the jet. However, the problem arises once I want to find the X/Y axis for the camera's orientation matrix. Because the jet is able to rotate freely along its local X and Y axis, my jet's and camera's up-vector is not a constant <0,1,0>. I can find the equation for the XY plane of my camera since I have the Z axis vector, but how can I separate this into the X and Y components of my camera matrix, such that it follows the orientation of my jet?

#### Share this post

##### Share on other sites
Advertisement

• Advertisement
• Advertisement

• ### Popular Contributors

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

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

• Total Topics
633695
• Total Posts
3013384
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!