shiting...@gmail.com
unread,Aug 2, 2018, 6:06:53 AM8/2/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cesium-dev
It's my code to add shadowMap and what to do later?
var scene = viewer.scene;
var camera1 = new Cesium.Camera(scene);
camera1.position = Cesium.Cartesian3.fromDegrees(-74.01076015,40.7038482,400);
var p1 = Cesium.Cartesian3.fromDegrees(-74.01076015,40.7038482,0);
var dir = new Cesium.Cartesian3();
Cesium.Cartesian3.add(p1,Cesium.Cartesian3.multiplyByScalar(camera1.position,-1,new Cesium.Cartesian3()),dir);
camera1.direction = dir;
// camera1.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
camera1.frustum.fov = Cesium.Math.PI_OVER_THREE;
camera1.frustum.near = 1.0;
camera1.frustum.far = 20000.0;
var shadow_stc = new Cesium.ShadowMap({
lightCamera:camera1,
enable:true,
isPointLight:true,
context:scene.context,
// fromLightSource:false
});
var CustomPrimotive = function(shadowMap){
this.shadowMap = shadowMap;
};
CustomPrimotive.prototype.update = function(frameState){
frameState.shadowMaps.push(this.shadowMap);
}
scene.primitives.add(new CustomPrimotive(shadow_stc));