Hi I am trying to make an abject follow the camera so I could achieve an effect of a rifle viewfinder. I am using OrbitControl. When I check camera.rotation.y it only shows that the range is from -PI/2 to PI/2 while I can rotate camera by 360 degrees. I cannot get my head around it please help!
so far I got there (it is only a part of my code):
pivot = new THREE.Object3D();
pivot.add(viewfinder);//adding viewfinder as a child of pivot
scene.add( pivot );
and later on
pivot.rotation.y = camera.rotation.y;
this allows to rotate my viewfinder but for some reason it is exactly by Pi/2 shifted so I deducted it from current camera position and I have this:
pivot.rotation.y = (camera.rotation.y - (Math.PI/2)) ;
and that allows me to rotate viewfinder with camera but only in the range of 180 degrees. How can I rotate it by full 360? Please help me. Thak You.