Sign in to follow this  
ajm113

Knowing How To Know When To Revers Direction Of A Matrix 4x4?

Recommended Posts

ajm113    355
OK, I am using the Matrix class from NeHe Lesson 48. This is a bit difficult to make a explanation on what my goal is, but if you have any questions, let me know. What I am trying to do is create a 3rd person camera that works like a flight simulator camera. The problem is if I move the world back to look I am moving forward and wanted to go to point 'B' which is my destination in 'front' of me, and decide to look left and up a bit, my world is going to rotate except for the player model and it will look I am not going to point 'B'! So, how can I change the direction the ship is going to so it still looks I am still going to point 'B' and rotate the ship down a bit so it looks I am looking up a bit and vice versa? [EDIT] The rotation of up and down is already covered, FYI, I figured out a solution for it.

Share this post


Link to post
Share on other sites
Alrecenk    400
This sounds like an issue with the order that you are handling your matrix multiplications in. First off, the view matrix for your camera position and angle should never actually move anything. It should just be stuck on the end of the opengl matrix pipeline for all objects( including the player), and then you readjust your camera position based on the players position in world space each frame.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this