0
嗨,我想讓一個賤民跟着相機,所以我可以實現步槍取景器的效果。我正在使用OrbitControl。當我檢查camera.rotation.y時,它只顯示範圍從-PI/2到PI/2,而我可以將相機旋轉360度。我無法繞過它,請幫助!如何用相機旋轉物體three.js
到目前爲止,我到了那裏(這只是我的代碼的一部分):
pivot = new THREE.Object3D();
pivot.add(viewfinder);//adding viewfinder as a child of pivot
scene.add(pivot);
,後來
pivot.rotation.y = camera.rotation.y;
這使得轉動我的取景器,但由於某種原因,正是由Pi/2相移,所以我從當前相機位置中扣除它,我有這樣的:
pivot.rotation.y = (camera.rotation.y - (Math.PI/2)) ;
和人讓我無法用相機旋轉取景器,但只能在180度的範圍內。我怎樣才能將它旋轉360度? 請幫幫我。 Thak你。
也許[this](http://stackoverflow.com/questions/31831425/static-object-in-scene-three-js/31835326#31835326)就是你所指的。 – WestLangley