Sign in to follow this  

Place Camera behind player -- this is a challenge

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

How on earth do I position my quaternion 3rd person camera behind a player posistion. The player is moved along like this: m_Pos.x += (m_VectorCircle[m_Angle].u * m_Speed) * (m_VectorCircle[m_UpAngle].u); m_Pos.y += (m_VectorCircle[m_UpAngle].v * 20); m_Pos.z += (m_VectorCircle[m_Angle].v * m_Speed) * (m_VectorCircle[m_UpAngle].u); I have a 3rd person camera, all the math, I can rotate around any axis around a point, or rotate the camera eye in place to simply look around. I have one way to position the camera behind the player: 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); m_Eye being the CameraFrom and m_Target being the PlayerPosition. m_Away behind the distance I want the camera behind the player. That works. But there has got to be a way to do it using some vector math. I just can't think of it. So, question is: How do I position the camera behind a moving position in a manner that I do not need to use the above code snippet?

Share this post


Link to post
Share on other sites

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