Hey, I've noticed that the radians seem to fluctuate when looking at a camera and trying to animate a flyover. I'm getting repetitive numbers when the camera rotates more than 90 degrees on either side. What could I be overlooking?
function calculateCameraDirection(camera){
radian = camera.rotation.y;
console.log(camera.rotation);
console.log(radian);
var xCoord = Math.sin(radian);
var zCoord = Math.cos(radian);
return new THREE.Vector3(xCoord, 0, zCoord);
}
var camMovingDirection = calculateCameraDirection(ctx.camera);
ctx.camera.position.z += 10 * camMovingDirection.z;
ctx.camera.position.x += 10 * camMovingDirection.x;