本文介绍了如何使ShadowCamera在three.js r73中可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Light.shadowCameraVisible = true;
发出警告
THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow ) instead.
添加
Scene.add(new THREE.CameraHelper(Light.shadow ));
出现错误
Uncaught TypeError: this.camera.updateProjectionMatrix is not a function (three.js :35002)
推荐答案
CameraHelper
构造函数接受一个Camera对象:
The CameraHelper
constructor takes a Camera object:
var light = new THREE.SpotLight( 0xFFAA55 );
light.castShadow = true;
var helper = new THREE.CameraHelper( light.shadow.camera );
scene.add( helper );
Three.js r107
Three.js r107
示例:
这篇关于如何使ShadowCamera在three.js r73中可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!