CZML - changing attitude of entity

This is my first post here so ‘Hello’.

In summary: I have a long list of longitude, latitude, altitude, pitch, roll and yaw and I would like a 3d model o follow / match these.

I have been through the posts on this forum, the Cesium documents and generally Googling like mad. Having waded through (and ‘borrowed’) relevant bits of the Sandcastle examples the code below runs in Sandcastle and the entity follows the path. Once I get to changing the attitude I get stuck.

At the part of the code highlight below I have used unit quaternions calculated outside of the CZML (in Excel) to no avail; I have changed the order of the XYZW terms and it still doesn’t work.

I think I need something like “Cesium.Quaternion.fromHeadingPitchRoll(heading, pitch, roll, result)” but I just can’t work out how to fit it into the CZML and how to store the heading, pitch and roll.

This is one of those occasions when I feel very old and very stupid.

Any assistance would be gratefully received,

Thank you

Hugh

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({

url : ‘https://assets.agi.com/stk-terrain/world’,

requestWaterMask : true,

requestVertexNormals : true

});

viewer.terrainProvider = cesiumTerrainProviderMeshes;

var builtInCzml = [{

“id” : “document”,

“version” : “1.0”,

“clock” : {

“interval” : “2017-08-21T20:00:01Z/2017-08-21T20:02:01Z”,

“currentTime” : “2017-08-21T20:00:01Z”,

“multiplier” : 1,

“range” : “LOOP_STOP”,

“step” : “SYSTEM_CLOCK_MULTIPLIER”

}

}, {

“id” : “Vehicle”,

“availability” : “2017-08-21T20:00:01Z/2017-08-21T20:02:01Z”,

“model” : {

“show” : true,

“gltf” : “…/…/SampleData/models/CesiumAir/Cesium_Air.glb”

},

“label” : {

“fillColor” : {

“rgba” : [0, 0, 0, 255]

},

“font” : “bold 10pt Segoe UI Semibold”,

“horizontalOrigin” : “LEFT”,

“outlineColor” : {

“rgba” : [0, 0, 0, 128]

},

“pixelOffset” : {

“cartesian2” : [10.0, 0.0]

},

“scale” : 1.0,

“show” : true,

“style” : “FILL”,

“text” : “GHIJKL”,

“verticalOrigin” : “CENTER”

},

“path” : {

“material” : {

“solidColor” : {

“color” : {

“rgba” : [255, 255, 0, 255]

}

}

},

“width” : 3.0,

“show” : true

},

“orientation”: {

“epoch” : “2017-08-21T20:00:01Z”,

    "unitQuaternion":[0, 0.7,0,0.7,1] // Etc., etc.,

        

                     ]

},

“position” : {

“interpolationAlgorithm” : “LAGRANGE”,

“interpolationDegree” : 1,

“epoch” : “2017-08-21T20:00:01Z”,

“cartographicDegrees” : [0, 0.3901825,9.05194,142] // Etc., etc.,

}

}];

var czmlDataSource = new Cesium.CzmlDataSource();

czmlDataSource.load(builtInCzml, ‘Sample CZML with 3D model’);

viewer.dataSources.add(czmlDataSource);

viewer.trackedEntity = czmlDataSource.entities.getById(‘Vehicle’);

``

Hi Hugh,

I had the same question here:

https://groups.google.com/forum/m/#!topic/cesium-dev/4j991i8iazQ

It looks like the server side calculation is the way to go but I haven't seen an example either.

Cheers,
Fidel