Sign in to follow this  

3rd Person Camera - Quaternion - One problem.

This topic is 4747 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 created a nice 3rd person camera. Using quaternions I can rotate any axis either around a point or rotateing the camera eye as to look around without moving. It I have the camera dictate its target (move the target exactly with the eye by using unit vectors) then it all works just fine. It looks beautiful...But of course that is not how it should be. The players position should dictate the camera's target and the camera class should be able to place the eye accordingly. This is where my problem occurs, if I move the player forward and then move the camera forward by the same speed because I have to move the camera using a unit vector the camera looses distance on the player even though they are moving at the same speed. So if I move forward just a plain distance between the (target - eye) then the eye is always at the players head... How on earth do I position the camera eye behind the camera target. This is my first attemp: m_Eye.x = m_Target.x - (m_VectorCircle[m_Angle].u * m_Away) * (m_VectorCircle[m_UpAngle].u); m_Eye.y = m_Target.y + (m_VectorCircle[m_UpAngle].v * 20); m_Eye.z = m_Target.z - (m_VectorCircle[m_Angle].v * m_Away) * (m_VectorCircle[m_UpAngle].u); .u and .v being the sin of and cos of (m_VectorCircle is a lookup table) Of course that works, but it is not the correct way to simulate a 3rd person camera....Although it does provide the eye to ALWAYS be behind the player. But it is not proper. How do I do it using vectors?

Share this post


Link to post
Share on other sites

This topic is 4747 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.

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