user2783211
user2783211

Reputation: 178

How do I change the size of shadowCamera?

I'm trying to update the width and height of the visibility of shadows from the light source, but I do not what comes out, no matter how much I did not twist something will not change

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

How do I change the size of shadowCamera ?

Upvotes: 0

Views: 365

Answers (1)

WestLangley
WestLangley

Reputation: 104833

Here is the pattern to follow to update the shadow camera on-the-fly:

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

three.js r.73

Upvotes: 1

Related Questions