three.js - Select the zone where to draw shadows with DirectionalLight -
i use directional light cast shadow on ground of scene. have single object. decided have small shadow keep shadow quality. problem can't manage shift position of shadow camera , keep on top of object.
i tried several things.
- targeting object works center of camera don't change, angle. don't want behavior. want keep same light direction.
- changing shadowcameraright of light nothing change
- changing shadowcameraright of shadowcamera, nothing change
- changing position of sahdowcamera. "debugger" moves shadow stop being drawn if did not anyting
i think there must pretty easy way of doing not find it.
edit :
var light = three.directionallight(...); var myobject = three.mesh(); //moving everyframe //here want move shadowcamera object stay in frustum
best
why not using object3d?
var light = three.directionallight(...); var myobject = three.mesh(); val alltogether = new object3d(); alltogether.add(light); alltogether.add(myobject); // here set light position want (relative) scene.add(alltogether);
in loop move object3d not mesh, moved along.
Comments
Post a Comment