Two functions to find position from object at a required distance and angle:
float circleObjectX(int distance, float angle)
{
float tempAngle=dbObjectAngleY(itsObjectNumber);
return distance*dbSIN(dbWrapValue(tempAngle+angle));
}
float circleObjectZ(int distance, float angle)
{
float tempAngle=dbObjectAngleY(itsObjectNumber);
return distance*dbCOS(dbWrapValue(tempAngle+angle));
}
Declare two variables:
(change angle every loop for circular motion)
float tempX=circleObjectX(100,180); // camera distance and angle relative to player
float tempZ=circleObjectZ(100,180); // camera distance and angle relative to player
Position camera:
dbPositionCamera (0,dbObjectPositionX(itsObjectNumber)+tempX,dbObjectPositionY(itsObjectNumber),dbObjectPositionZ(itsObjectNumber)+tempZ);
NOTE: Only rotates around y-axis. (could be extended or changed for more rotation, but I usually change the height-yaxis-seperataly)