2012-09-05 32 views
0

我將更改近剪裁平面參數,然後更新相機以查看結果。如何更新Three.JS中的CombinedCamera參數?

首先我用近剪裁平面= 10創建相機,然後我想將它設置爲700.我寫了下面的代碼,但在camera.updateProjectionMatrix()之後; ,它再次設置爲10!

camera = new THREE.CombinedCamera(window.innerWidth ,window.innerHeight ,40 ,10 ,10000 ,-500 ,100); //near clipping plane is defined 10 
camera.position.set(1000, 1000, 1000); 
camera.near = 700; //near =700 
camera.updateProjectionMatrix(); //near=10 !!!! whyyyyy!!! 
scene.add(camera);     

然後我用: 相機=新THREE.PerspectiveCamera(40,window.innerWidth/window.innerHeight,1,10000); camera.near = 700; camera.updateProjectionMatrix();

它解決了!

我認爲在使用camera.updateProjectionMatrix()時,會出現「CombinedCamera」中的錯誤。

回答

1

爲了您CombinedCamera,你想做的事是這樣的:

camera.cameraP.near = 700; 
camera.updateProjectionMatrix();