Hello,
I am trying to use a GLTF model including some customized animations in an Entity which added by CZML file. But I havan`t found any documents about how to schedule these animations when the model is running on the path…
So, could you tell me how to solve this problem? thanks.
here is my code :
const czmlData = Cesium.CzmlDataSource.load("http:localhost:3000/data/xingli.czml");
czmlData.then((ds)=>{
viewer.dataSources.add(czmlData);
let rocket_entity = ds.entities.getById("LaunchVehicle/LaunchVehicle1");
viewer.trackedEntity = rocket_entity;
console.log(rocket_entity);
// load model
const model = viewer.scene.primitives.add(Cesium.Model.fromGltf({
url: "http:localhost:3000/model/rocket.glb",
minimumPixelSize: 10,
maximumScale: 10,
silhouetteColor: Cesium.Color.WHITE,
silhouetteSize: 0
}));
rocket_entity.model = model; // it doesn`t work
// schedule animations
model.readyPromise.then(()=>{
model.activeAnimations.add({
name: 'yiji'
});
});
});
I added my model created by Cesium.Model.fromGltf, and add this model to my Entity. However, it didn`t work in the scene…