如何更改shadowCamera的大小?

时间:2013-09-16 08:35:59

标签: three.js

我正在尝试更新光源阴影可见度的宽度和高度,但我不会出现什么,无论我多少没有扭曲的东西都不会改变

https://github-camo.global.ssl.fastly.net/7fb9f1127364d27f273ee4795f79bbcb7db1f54d/687474703a2f2f736c2d636d732e636f6d2f692f6b6f726e65722d323031332f326539303363383034303161323665336133313965353265346634622e706e67

if(object.shadowCameraLeft !== undefined) {
                methods.opValI(9,{name:'Sh Cam Left',value:object.shadowCameraLeft,step:10,fix:'2'},op,function(v){
                    object.shadowCameraLeft = v; // Trying to change
                });
            }

            if(object.shadowCameraRight !== undefined) {
                methods.opValI(9,{name:'Sh Cam Right',value:object.shadowCameraRight,step:10,fix:'2'},op,function(v){
                    object.shadowCameraRight = v; // Trying to change
                });
            }

object.shadowCameraLeft = v; // Trying to change
object.shadowCameraRight = v; // Trying to change

如何更改shadowCamera的大小?

1 个答案:

答案 0 :(得分:1)

以下是动态更新阴影相机的模式:

light.shadow.camera.left = - 100;
light.shadow.camera.updateProjectionMatrix(); // important!

three.js r.73