   camera following the car
  Hi!I''m having problem with my camera following a car (in a third person way)The camera should follow the car from behind in a smooth kind of way, I mean like in most racing games the camera isn''t changed that much just because I turn left for a microsecond and then turn back.I started like this (but this doesn''t work very well, not at all actually)if (Vehicle->Direction != m_Camera.GetYRotation()){m_fCameraDirection = m_Camera.GetYRotation() - Vehicle-Direction;if (fabs(m_fCameraDirection) > 0.5f){   if (m_fCameraDirection < 0) m_fCameraDirection+=0.1f;   else m_fCameraDirection-=0.1f;}else   m_fCameraDirection = Vehicle->Direction;}m_Camera.Point(   Vehicle->XPos -(float)sin(m_fCameraDirection) * m_Zoom,   Vehicle->YPos + 100.0f,   Vehicle->ZPos -(float)cos(m_fCameraDirection) * m_Zoom,   Vehicle->XPos,   Vehicle->YPos + m_YMove,   Vehicle->ZPos);any ideas?  
  You may want to try an approach where the camera is always moving a percent closer to the direction of the car.  It should be as simple as:float rate = 0.1f  // 10%m_fCameraDirection = rate*m_Camera.GetYRotation() - (1.0f-rate)*VehicleDirection;However, please keep in mind that you'll still need to watch out for a special situation (this applies to your previous code also)Your car is pointed at 10 degrees and the camera is pointed at 350 degrees.  You would LIKE for camera to take the short route around the circle which is only 20 degrees away.  However, the equation above will cause it to take the long route (340 degrees).  There are numerous ways to get around this, I've never found a "beautiful" way though.  =P  If anyone does, please let me know.Brett[edited by - Bretttido on September 16, 2002 3:07:24 PM]