"I have added a glb file with an interior as an entity.model and placed the spacecraft in space. I would like to enable the ability to look around from inside the spacecraft. The spacecraft is orbiting and receiving its position every 3 seconds using a SampledPositionProperty. I have successfully set the camera position to the center of the entity using a postrender event listener. However, when I drag the mouse over the surface of the globe, the camera translation doesn’t seem to work properly. I’m looking for an alternative approach.
If the viewer.current.trackedEntity = entity is set, how can I enable the ability to look around from a first-person perspective within the interior of the entity?"
const now = Cesium.JulianDate.now();
viewer.current.clock.startTime = Cesium.JulianDate.addSeconds(
now,
-3,
new Cesium.JulianDate()
);
viewer.current.clock.currentTime = Cesium.JulianDate.addSeconds(
now,
-3,
new Cesium.JulianDate()
);
viewer.current.clock.clockRange = Cesium.ClockRange.UNBOUNDED;
viewer.current.clock.multiplier = 1.0;
axios
.get("https://api.wheretheiss.at/v1/satellites/25544")
.then(({ data }) => {
const { longitude, latitude, altitude } = data;
positionProperty.current.addSample(
Cesium.JulianDate.now(),
Cesium.Cartesian3.fromDegrees(longitude, latitude, altitude * 1000)
);
viewer.current.entities.add({
id: "cupola",
model: {
uri: Cupola,
minimumPixelSize: 128,
maximumScale: 20000,
},
position: positionProperty.current,
// show:false
});
const entity = viewer.current?.entities.getById("cupola");
viewer.current.trackedEntity = entity;
const interval = setInterval(() => {
axios
.get(“https://api.wheretheiss.at/v1/satellites/25544”)
.then(({ data }) => {
const { longitude, latitude, altitude } = data;
positionProperty.current.addSample(
Cesium.JulianDate.addSeconds(
Cesium.JulianDate.now(),
3,
new Cesium.JulianDate()
),
Cesium.Cartesian3.fromDegrees(longitude, latitude, altitude * 1000)
);
});
}, 3000);