Need help with camera...
#1

I have one question: how do I make camera spin around player? i want to make, but nothing is happening to me.. Please help.
Reply
#2

Use trigonometry
Reply
#3

Can you explain more detailed please?
Reply
#4

Here.
Reply
#5

Quote:
Originally Posted by ʞɹod ɹǝpıds || SpiderPork
Haha, you made me laugh.


I didn't get your point,
Aiva.
Reply
#6

It's to encourage people to use ******.
Reply
#7

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;
}
Reply
#8

Too bad it will continue doing that all the time...
Reply
#9

It is just exemple! Main formula to get spinning camera around point (player pos here).
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)