Concerning the camera movement using joystic. Using the code provided in tutorial 15, I added the pan of the camera.

My issue is How I calculate the camera movement using joystic force, in order to use the relative turn?. I want to use joystic force forwards only in position 2, and not a compose movement of joystick forward + left.

So, how I modify the code to get the movement depicted in red, and not the one in black ( as it goes now with the code bellow)



while(1)
{
camera.y-= joy_force.x;
camera.x += joy_force.y;
if (joy_1) camera.z += 1;
if (joy_2) camera.z -= 1;

if (joy_4)camera.pan+=0.3;
if (joy_5)camera.pan-=0.3;

wait(1);
}