Oh great. This thread is exactly what I need.
I will add a offset at my camera too but there is no clue for me how I can make this done.
So, here it is:
(it is a standart 3rd person view)
//////////////////////////////////////////////////////////////////////////////////////////////
void CAMERA_calculate()
{
while(1)
{
cameraContainer.currentDistance = (cos(cameraContainer.eulerTilt) * cameraContainer.totalDistance);
camera.x = (cameraContainer.pivotX - cos(cameraContainer.eulerPan) * cameraContainer.currentDistance);
camera.y = (cameraContainer.pivotY - sin(cameraContainer.eulerPan) * cameraContainer.currentDistance);
camera.z = (cameraContainer.pivotZ + sin(cameraContainer.eulerTilt) * cameraContainer.totalDistance);
camera.pan = cameraContainer.eulerPan;
camera.tilt = -(cameraContainer.eulerTilt);
camera.roll = 0;
wait(1);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
The cameraContainer contains all the informations about the player like xyz and pan/tilt.
It would be nice if anybody can help me and Altarius, feel free to copy this code and use it for yourself (if it works of course)