i want to update Geometry instance model matrix framely,but it not work;
var instance = new Cesium.GeometryInstance({
geometry: new Cesium.RectangleGeometry({
rectangle: Cesium.Rectangle.fromDegrees(105.20, 30.55, 106.20, 31.55),
vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEXT_FORMAT
})
});
viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances: instance,
appearance: new Cesium.EllipsoidSurfaceAppearance({
material:Cesium.Material.fromType(‘Stripe’)
})
}));
var startTime=Date.now();
viewer.clock.onTick.addEventListener(function(){
var totalTime=(Date.now()- startTime)/1000;
var index=Math.floor(totalTime);
instance.modelMatrix=Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(100000index,1000,100000index));
console.warn(index);
});
``
在 2019年5月27日星期一 UTC+8下午7:17:10,bo dong写道:
Try moving the primitive’s model matrix instead. See this modified Sandcastle example.