Move camera left/right on x-axis of the rotation

Started by moyosa, January 15, 2015, 03:27:23 PM

Previous topic - Next topic

moyosa

Hi,

I've got a camera and it has it's own rotation I set in the setBack. Now I want the translate let's say 10 px to the left en my camera is tilted. it does not seem to go left in the rotation x-axis but just the normal work x-axis.



So when I do a setPosition of (10,0,0). it exactly does that. But how doI translate of the rotation x-axis?



EgonOlsen

You have to translate it along the rotated x-axis instead. You can get it from your Camera instance, multiply it with the length of the translation and add the result to the current position. Either that or use the moveCamera method that takes an int constant as the first parameter.