I am trying to show flights following an arc-ing path from one city to another.
Using the Cesium airplane model provided in the samples, it works perfectly fine using just the VelocityOrientationProperty as orientation alone.
eg.
property = new Cesium.SampledPositionProperty();
property.addSample(startTime, startPosition); property.addSample(midTime, midPosition);
property.addSample(stopTime, stopPosition);
var arcEntity1 = viewer.entities.add({
position: property,
orientation: new Cesium.VelocityOrientationProperty(property),
model: {
uri: url + "Cesium1.25/Apps/SampleData/models/CesiumAir/Cesium_Air.gltf",
minimumPixelSize: 128,
maximumScale: 10000
},
path: {
resolution: 1200,
material: new Cesium.PolylineGlowMaterialProperty({
glowPower: 0.10,
color: Cesium.Color.BLUE
}),
width: 10,
leadTime: 0,
trailTime: 1e10
}
});
However, if I use any other airplane models, the model is orthogonal to the flight path as it travels along it.
I was wondering if there's any way to rotate the model first (either in the .gltf file itself or otherwise) so that it uses VelocityOrientationProperty, but is also facing the correct way.
My question is similar to this :
His answer was to use:
entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(currentPos, heading+Math.PI, 0, 0);
but I need use the VelocityOrientationProperty to retain heading, pitch, roll etc as the flight travels on the arc.
Is there any way of using headingPitchRollQuaternion * VelocityOrientationProperty at all?
Thanks!