2016-02-03 45 views
8
Light.shadowCameraVisible = true; 

dà un avvertimentoCome rendere visibile ShadowCamera in three.js r73?

THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper(light.shadow) instead. 

sull'aggiunta

Scene.add(new THREE.CameraHelper(Light.shadow)); 

dà un errore

Uncaught TypeError: this.camera.updateProjectionMatrix is not a function (three.js :35002) 
+3

Il vostro sembra essere intanciating il CameraHelper sbagliata. Il costruttore prende un oggetto Camera, non una luce. – micnil

+0

sul dare oggetto fotocamera come input non mostrando la telecamera shadow insted di esso mostra un asse xey :) – ArUn

+0

Questa è la stessa domanda di [qui] (http://stackoverflow.com/q/35171346/1697459). Non ci sono ancora risposte. – Wilt

risposta

12

Il costruttore CameraHelper prende un oggetto Camera:

var light = new THREE.SpotLight(0xFFAA55); 
light.castShadow = true; 

var helper = new THREE.CameraHelper(light.shadow.camera); 
scene.add(helper); 

Three.js R73

Esempio: http://jsfiddle.net/f17Lz5ux/5131/