Need help with camera...
#10

Quote:
Originally Posted by Nubotron
It is simple, here is a exempel:
pawn Код:
new Float:x, Float:y, Float:z, Float:a;

public OnPlayerCommandText(playerid, cmdtext[])
{
  if (!strcmp(cmdtext, "/lol"))
  {
    GetPlayerFacingAngle(0, a); //the start angle (camera will start spining from the back of the player)
    SetTimer("SpinCam", 10, true); //run the timer to move camera
    return true;
  }
  return false;
}

forward SpinCam();
public SpinCam()
{
  GetPlayerPos(0, x, y, z);
  SetPlayerCameraPos(0, x - 4 * floatsin(-a, degrees), y - 4 * floatcos(-a, degrees), z + 1); //move in perfect circle, at a radius of 4 units from the player.
  //SetPlayerCameraPos(0, x - 4 * floatsin(-a, degrees), y - 7 * floatcos(-a, degrees), z + 1); //move in elipses, nice effect, test it!
  SetPlayerCameraLookAt(0, x, y, z + 0.5);

  if (a >= 360.0)
    a = 0.0;
     
  a += 0.5;
}
thenka, i'll try this.
Reply


Messages In This Thread
Need help with camera... - by AiVAMAN - 19.03.2009, 12:40
Re: Need help with camera... - by Nubotron - 19.03.2009, 12:42
Re: Need help with camera... - by AiVAMAN - 19.03.2009, 16:19
Re: Need help with camera... - by SpiderPork - 19.03.2009, 17:40
Re: Need help with camera... - by MenaceX^ - 19.03.2009, 17:42
Re: Need help with camera... - by SpiderPork - 19.03.2009, 17:43
Re: Need help with camera... - by Nubotron - 19.03.2009, 18:44
Re: Need help with camera... - by LarzI - 19.03.2009, 19:39
Re: Need help with camera... - by Nubotron - 19.03.2009, 19:48
Re: Need help with camera... - by AiVAMAN - 20.03.2009, 15:25

Forum Jump:


Users browsing this thread: 2 Guest(s)