1. A concise explanation of the problem you're experiencing.
Hi, I have a CZML file with flight paths that I want to attach a Cesium cone graphic to. I have no problem attaching the cone and getting it to follow the path, but right now the cone is oriented with its base firmly on the ground. I wanted to orient the cone to be rotated 90 degrees such that it looks side ways. This is not a problem normally--I can set the orientation using headingPitchRollQuaternion, but then I sacrifice the ability to set the orientation of the cone to follow the path (i.e. make the entity point in the proper direction according to the path using the commented out VelocityOrientationProperty line shown below). Basically, I need to set the orientation of the cone to be rotated 90 degrees, but when I use the entity.orientation = new Cesium.VelocityOrientationProperty(entity.position); line afterwards, it doesn't do the 90 degree rotation.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer('cesiumContainer');
var geocachePromise = Cesium.CzmlDataSource.load('/Apps/Sandcastle/output.czml');
var cylinder = new Cesium.CylinderGraphics({
length: 200,
topRadius: 1,
bottomRadius: 200
});
var headingPitchRoll = new Cesium.HeadingPitchRoll.fromDegrees(90,0,0);
var orientation = new Cesium.Quaternion.fromHeadingPitchRoll(headingPitchRoll);
console.log(orientation);
geocachePromise.then(function(dataSource) {
// Add the new data as entities to the viewer
viewer.dataSources.add(dataSource);
// Get the array of entities
var geocacheEntities = dataSource.entities.values;
for (var i = 0; i < geocacheEntities.length; i++) {
var entity = geocacheEntities[i];
entity.cylinder = cylinder;
entity.orientation = orientation;
//entity.orientation = new Cesium.VelocityOrientationProperty(entity.position);
//Can't set orientation again??
}
});
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Likewise, I would like a solution for this so that I can rotate external 3D gltf models (like an airplane) so that a) it's nose points in the correct direction and b) it's nose orients itself through the path timeline to turn according to the path direction/velocity.
4. The Cesium version you're using, your operating system and browser.
I am using Cesium 1.46, MacOS, and running the sandbox locally. Thanks so much!