Hi,
I have a 3d Terrain map and a path and a 3D model in GLB all this works great if I use trackedEntity (v1.122). However the camera is locked and the user cant rotate round the model. So Instead I use the following …
const planeEntity = viewer.entities.add({
availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
start: startTime,
stop: stopTime
})]),
position: position,
orientation: adjustedOrientation, // Use the adjusted orientation
model: {
uri: 'https://xxxxxxx/3d/Airtractor4.glb', // Plane model URI
scale: 1.0
},
path: {
resolution: 1, // Smoothness of the path
material: new Cesium.PolylineGlowMaterialProperty({
glowPower: 0.1,
color: Cesium.Color.YELLOW
}),
width: 10
}
});
// Remove the trackedEntity assignment
// viewer.trackedEntity = planeEntity;
console.log(planeEntity);
// Set up an EntityView to follow the plane
const entityView = new Cesium.EntityView(planeEntity, viewer.scene, viewer.scene.mapProjection.ellipsoid);
// Update the camera to follow the plane
viewer.scene.preRender.addEventListener(function (scene, time) {
if (planeEntity.isAvailable(time)) {
entityView.update(time);
}
});
// Optionally, adjust the camera offset
entityView.offset3D = new Cesium.Cartesian3(-500.0, -500.0, 300.0);
The path loads and the timeline is running but there is NO planeEntity model visible?
The console.log seems to indicate that the planeEntity is available at the time the entityView is being created.
Any suggestions please as I’m totally stuck !
Many Thanks
Ted