Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problems with the camera #262073
04/21/09 19:45
04/21/09 19:45
Joined: Apr 2009
Posts: 2
N
NocturnalChild Offline OP
Guest
NocturnalChild  Offline OP
Guest
N

Joined: Apr 2009
Posts: 2
Hello everybody!!!
I am new in this area of programming I have evolved much more ...

Well, I'm here with a doubt with the camera.
-I did it, but I said in part as:
camera.pan = player.pan;
then the camera turns to the player right?
more I only rodasse camera, and the player remains, there I said this:
camera.pan = 10, / / the 10 is just one example
only when I turn the camera with this statement:
camera.pan + = 2 * (mouse_force) * time_step;
the camera rotates, but is not on axis with the player.

- and also when I turn the camera near a wall, it passes through the wall, Fasso and I to cross it in the wall?

if someone can help me, I will be very grateful.

camera code:

function camera()
{
...
while(1)
{
...
camera.x = player.x - 350 * cos (player.pan);//APROXIMA A camera.y = player.y - 350 * sin (player.pan); //DESLOCAMENTO
camera.z = player.z + 450; //VISAO ABAIXO OU ACIMA DO HEROI
camera.pan = player.pan; //O HEROI GIRA JUNTO COM A CAMERA
camera.tilt = -35;
wait(1);
}
}

sorry for my bad English, is that I'm from Brazil

Re: Problems with the camera [Re: NocturnalChild] #262079
04/21/09 20:30
04/21/09 20:30
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline
Senior Member
Ralph  Offline
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
this is not good:
camera.x = player.x - 350 * cos (player.pan);//APROXIMA A camera.y = player.y - 350 * sin (player.pan); //DESLOCAMENTO

You have written the camera.y stuff like a comment:

camera.x = player.x - 350 * cos (player.pan);//APROXIMA A
camera.y = player.y - 350 * sin (player.pan); //DESLOCAMENTO

Now it should work.

Last edited by Ralph; 04/21/09 20:31.
Re: Problems with the camera [Re: NocturnalChild] #262081
04/21/09 20:39
04/21/09 20:39
Joined: Apr 2009
Posts: 2
N
NocturnalChild Offline OP
Guest
NocturnalChild  Offline OP
Guest
N

Joined: Apr 2009
Posts: 2
no ....

You should not have understood me, my error is not with the operation, but the way he works,
and is verdadena time that I put here in the forum that error happened there more to write my code this way:

camera.x = player.x - 350 * cos (player.pan);
camera.y = player.y - 350 * sin (player.pan);
camera.z = player.z + 450;
camera.tilt = -35;

waiting for answers...


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1