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

daje ostrzeżenieJak zrobić ShadowCamera widoczną w three.js r73?

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

na dodanie

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

daje błąd

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

Twój wydają się być intanciating się CameraHelper źle. Konstruktor bierze obiekt Camera, a nie Light. – micnil

+0

o podaniu obiektu kamery jako wejścia nie pokazuje zainstalowanej kamery cieni pokazuje oś xi y :) – ArUn

+0

To jest to samo pytanie co [tutaj] (http://stackoverflow.com/q/35171346/1697459). Nie ma tam jeszcze odpowiedzi. – Wilt

Odpowiedz

12

Konstruktor CameraHelper zajmuje obiektu Camera:

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

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

Three.js R73

Przykład: http://jsfiddle.net/f17Lz5ux/5131/