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