Jump to content
  • Advertisement
Sign in to follow this  

Place Camera behind player -- this is a challenge

This topic is 5114 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
Sign in to follow this  

  • Advertisement

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!