Finally getting to work with Cesium and having some basic trouble -- I want to make a generic polygon that I reposition via a matrix (on an ongoing basis). Really, it's a data source but it's listening to live data coming in over SSE, so I don't have it set up as a data source right now.
So first, I've ended up defining some czml for the data, an exciting arrow shape:
const czml = [{
"id" : "document",
"name" : "CZML Geometries: Polygon",
"version" : "1.0"
}, {
"id" : "arrow",
"name" : "the arrow",
"polygon" : {
"positions" : {
"cartesian" : [0, 0, 100000,
-10, -3, 100000,
0, 10, 100000,
10, -3, 100000,
0, 0, 100000
]
},
"material" : {
"solidColor" : {
"color" : {
"rgba" : [255, 100, 0, 128]
}
}
},
"extrudedHeight" : 50
}
}];
I can then load that, but when I set the orientation nothing seems to happen. The entity is always drawn near the north pole.
let dataSourcePromise = CzmlDataSource.load(czml).then(function(loadedData){
let entity = loadedData.entities.values[0];
const hpr = new HeadingPitchRoll(heading, 0.0, 0.0);
const transform = Transforms.headingPitchRollToFixedFrame(raisedPoint[0], hpr);
entity.orientation = transform; // this doesn't work, nor does using position.
viewerWrapper.viewer.entities.add(entity);
Is there a better/correct way to do this? What tutorial should I be looking at? I've tried everything I can think of.
Thanks much
Tamar