Reputation: 178
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
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
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