Damn camera! Need help.
#5

pawn Код:
SetPlayerPos(playerid, SavePos[playerid][picX], SavePos[playerid][picY], SavePos[playerid][picZ]+10); // so the player isn't visible.

// SetPlayerFacingAngle() is unnecessary, this rotates the player in the world. We are dealing strictly with cameras.

SetPlayerCameraPos(playerid, SavePos[playerid][picX], SavePos[playerid][picY], SavePos[playerid][picZ]);

#define DISTANCE 10.0
SetPlayerCameraLookAt(playerid, SavePos[playerid][picX] + DISTANCE * floatsin(-SavePos[playerid][picA], degrees), SavePos[playerid][picY] + DISTANCE * floatcos(-SavePos[playerid][picA], degrees), SavePos[playerid][picZ]);
This code calculates a new point that is DISTANCE away from the Camera's position, it makes use of the Camera facing angle you stored previously, and some laws of triangles. If you would like a more in-depth explanation let me know.

Changing DISTANCE to a larger value will change the Camera Look at location to a point that is farther away from the Camera.

Reply


Messages In This Thread
Damn camera! Need help. - by Lewwy - 23.05.2009, 17:52
Re: Damn camera! Need help. - by Weirdosport - 23.05.2009, 18:43
Re: Damn camera! Need help. - by Lewwy - 23.05.2009, 18:45
Re: Damn camera! Need help. - by Lewwy - 23.05.2009, 19:08
Re: Damn camera! Need help. - by samgreen - 24.05.2009, 06:55
Re: Damn camera! Need help. - by Lewwy - 24.05.2009, 07:54
Re: Damn camera! Need help. - by Calgon - 15.08.2009, 13:40

Forum Jump:


Users browsing this thread: 1 Guest(s)