Rotating and translating objects can be tricky. While you can successfully perform both actions, the challenge arises when rotating objects as their orientation gets lost -- causing the objects to move in the direction they are facing.
if( keyboard.pressed("up"))
objects[movementControls.translate].translateX(1);
if( keyboard.pressed("down"))
objects[movementControls.translate].translateX(-1);
if( keyboard.pressed("left"))
objects[movementControls.translate].translateZ(-1);
if( keyboard.pressed("right"))
objects[movementControls.translate].translateZ(1);
if( keyboard.pressed("x"))
objects[movementControls.rotate].rotation.x+=0.1;
if( keyboard.pressed("y"))
objects[movementControls.rotate].rotation.y+=0.1;
if( keyboard.pressed("z"))
objects[movementControls.rotate].rotation.z+=0.1;
Is there a method available to rotate only the object without affecting the axes?