   Camera Woes
  Hello.I'm having some issues dealing with cameras in a 3D game world.  For our game, the camera has been set up to "target" a single object.  That is, it will always perform a 'Look At' function with the target object.  The camera has three high-level properties:Distance - the distance from the object's point of originHeight - height above or below the object's point of originRotation - rotation around the object's point of originI've been working on a function which allows the coder to create various camera effects, such as zooming in or out, pulling a 180 around the target, following a special move, and so on.  The distance traversed must be defined.  So far, I've tried two methods to perform this function.  Both work fine until I try to add acceleration and deceleration.  I can't figure out how to compensate for the lost distance while accelerating/decelerating.I require the function to allow the following:- input a start/end for distance, height, and rotation- input some measurement for acceleration and deceleration- be able to synchronize completion of movements for all three propertiesFirst, I tried to define the movements by Time.  The user would define the start and end distances for each of the three properties, as well as the duration of the movement.  For acceleration and deceleration, the user would also define that end point of acceleration and the start point of deceleration on a scale of 0.0 - 1.0 (0.0 represents the start, and 1.0 represents the end).  The program then calculates the maxspeed to move the camera in order to cover the distance in the set amount of time.  This works without acc/dcc, but once those are introduced, the distance lost while accelerating/decelerating adds up.  To fix this, I need to calculate a new maxspeed, which would mean that I also have to calculate a new rate of acceleration.  This just leads me in circles, and I can't figure out what to do at all.So I tried going by Traversal instead of Time.  It completely ignores the time it takes to move a certain distance.  Instead, it uses acceleration/deceleration cutoffs and rates for each of the three properties.  Somehow, it too is giving me problems.  Synchronizing the movement of all three properties has become very difficult, and I have the new problem of trying to ensure that the distance is travelled correctly with acc/dcc.  Because the movement relies on a delta time, I cannot calculate the exact distance that will be covered when decelerating, so I can't calculate a deceleration rate that will both be constant and satisfy the full distance.If anyone can help me determine an equation to compensate for the accel/decel losses, I would greatly appreciate it.Thanks.   
  Let me get htis straight, you're accelerating towards your target with a height, distance, and rotation?;  Correct.  Each of the three properties has its own acceleration/deceleration rate so that all three properties may start and end simultaneously.   ;  Wouldn't it be better to use this:x  + = (target_x - x) / 5y  + = (target_y - y) / 5z  + = (target_z - z) / 5or is that not what you had in mind, because using the above eliminates the acceleration components, but makes a smooth camera.;  No, acceleration must be controlled.  I also cannot add static values because delta time is not constant.For example, smooth acceleration looks like this:// Store the current time (add DT to it)m_fCurSeqTime += fDT;// Update the sequence pointm_fCurSeqPoint = m_fCurSeqTime / m_fSeqDuration;// Accelerationif((m_fCurSeqPoint <= m_fAccelPoint) && (m_fCurSeqPoint >= 0.0f)){// AmountToAdd/Subtract = MaxSpeed * LenAccelInSeqPointsfloat fAmountToAddDistance= m_fMaxSpeedDistance * (m_fCurSeqPoint / m_fAccelPoint);float fAmountToAddHeight= m_fMaxSpeedHeight * (m_fCurSeqPoint / m_fAccelPoint);float fAmountToAddRotation= m_fMaxSpeedRotation * (m_fCurSeqPoint / m_fAccelPoint);// Move the cameraGFX->setCameraDistance(GFX->getCameraDistance() + fAmountToAddDistance);GFX->setCameraHeight(GFX->getCameraHeight() + fAmountToAddHeight);GFX->setCameraRotation(GFX->getCameraRotation() + fAmountToAddRotation);}As opposed to simply adding MaxSpeed until the total distance is traversed.  It's the counting for delta time that makes all the difference.   