3rd Person Camera - Quaternion - One problem.

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

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 on other sites
I move the player just like the tiny code snippet i posted above.

The camera though just needs to stay behind always....ugh

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• Forum Statistics

• Total Topics
632936
• Total Posts
3009312
• Who's Online (See full list)

There are no registered users currently online

×