Thanks Patrick,
Yes, I’m sorry that I was vague. It seemed there was some talk of making czml model orientation easier than figuring out quaternions. I’d be very interested
in that. I am unable to orient a model on a given lon, lat, height path in czml with “orientation : unitQuaternions”. My model stays in a fixed orientation. The only way I am able to get my glider to follow a path is to hardwire it into the html, eeks!
– just so that I may use the easy way to orient the model with “orientation : new Cesium.VelocityOrientationProperty(position)”.
I don’t know how to put Cesium functions into a czml and it seems that the milktruck czml is able to do this with something in the html header. I am a little
lost as to piecing together the parts I need out of the many provided examples in sandcastle or in calculating quaternions.
Thank you for your attention. I would really be excited to get the model into my Cesium App!
Susan
Hardcoded into my html:
…
//Generate a pattern with varying heights.
function computeFlight(lon, lat, height) {
var concavex = [-89.0000,-88.5833,-88.0500,-87.5667,-87.1667,-86.8000,-86.4167,-86.1500,-85.8333,-85.6333,-85.3833,-85.2667,-85.1833,-85.2333,-85.2500,-85.2167,-85.2167,-85.3000,-85.3000,-85.4333,-85.7333,-86.2833,-86.8667,-87.2500,-87.5833,-87.8000,-87.9833,-88.2500,-88.4833,-88.6167,-88.9000,-89.1333,-89.3167,-89.6500,-90.0667,-90.5333,-91.0000,-91.4167,-92.0000,-92.4667,-92.8500,-93.1333,-93.4333,-93.4500,-93.3833,-93.1167,-92.9667,-92.7000,-92.3500,-92.2000,-91.9000,-91.5500,-91.1000,-90.7167,-90.3167,-89.9667,-89.6833,-89.5333,-89.2167,-88.4667,-87.6833,-87.6000,-87.6500,-87.9500,-89.0833,-89.9333,-90.8000,-91.7333,-92.8500,-92.9833,-93.3500,-93.8500,-94.3833,-94.8167,-95.4167,-95.8500,-96.1500,-96.1833,-96.1667,-96.1500,-96.0667,-96.0667,-96.2000,-96.3000,-96.2667,-96.1000,-95.8333,-95.5667,-95.3000,-94.7333,-94.1500,-93.7667,-93.4333,-93.1000,-92.9167,-92.9333,-93.0167,-93.0333,-93.0833,-93.1500,-93.1667,-93.1667,-93.1167,-92.9667,-92.6667,-92.3833,-92.1167,-91.4833,-90.8167,-89.4333,-88.8667,-88.6500,-88.0167,-87.7500,-87.7167,-87.9167,-88.4833,-89.2167,-90.1000,-90.8000,-91.2000,-91.5833,-91.9500,-92.0833,-92.0500,-91.4000,-90.5667,-90.0167,-89.5167,-88.9167,-88.4000,-88.0500,-87.7333,-87.5667,-87.4667,-87.4500,-87.4500,-87.5333,-87.7500,-88.0333,-88.5667,-89.5667,-90.0833,-90.6333,-90.6333,-90.7667,-90.4667,-89.8500,-89.4500,-89.1167,-88.7833];
var concavey = [28.2000,28.1667,28.1500,28.0500,27.9500,27.8833,27.7667,27.5833,27.4167,27.2500,27.0667,26.9000,26.6500,26.5000,
26.2667,25.8667,25.4833,25.1333,24.8833,24.7000,24.4333,24.2333,24.1667,24.1500,24.2000,24.3333,24.4167,24.6167,
24.8167,24.9333,25.1667,25.4167,25.6000,25.7667,25.8333,25.8500,25.8500,25.8333,25.8000,25.8000,25.8000,25.8667,
26.0167,26.2333,26.4333,26.7333,26.8333,26.9667,27.0833,27.1167,27.1833,27.2500,27.2833,27.3833,27.3667,27.4500,
27.5333,27.6667,27.8333,27.8000,27.3667,27.0167,26.5500,26.2667,26.1500,26.0667,26.0000,25.9500,25.8333,25.8000,
25.8833,25.8333,25.8000,25.8000,25.7333,25.6667,25.4000,25.0000,24.6333,24.1500,23.7167,23.4167,23.0500,22.6167,
22.2167,21.9167,21.7667,21.5833,21.5167,21.5167,21.5167,21.5167,21.5667,21.6333,22.0333,22.5167,22.7167,22.9667,
23.1833,23.4000,23.7167,24.2167,24.5333,24.7500,25.1000,25.2167,25.3667,25.8500,26.0833,26.4500,26.4833,26.4833,
26.2500,25.8500,25.2667,24.8667,24.5167,24.3667,24.3000,24.2667,24.0833,23.8333,23.4167,22.8000,22.6167,22.3500,
22.4000,22.5167,22.6000,22.8333,23.2000,23.4667,23.7500,23.9667,24.2500,24.5500,24.9667,25.2833,25.5167,25.7833,
26.0667,26.5500,26.7000,26.7667,26.7667,27.0667,27.3833,27.8333,28.0500,28.2333,28.3833];
var concaveh = [326172.4138,298396.5517,272482.7586,254068.9655,245689.6552,242482.7586,234775.8621,229913.7931,226810.3448,
226189.6552,224844.8276,224896.5517,224068.9655,223758.6207,223137.931,224275.8621,223344.8276,222465.5172,
222568.9655,220137.931,218896.5517,247137.931,322086.2069,352034.4828,367965.5172,366000,350120.6897,
313913.7931,214241.3793,214500,216155.1724,218586.2069,223137.931,226396.5517,226034.4828,219568.9655,
217758.6207,222310.3448,243827.5862,233482.7586,229034.4828,225258.6207,232913.7931,292293.1034,306051.7241,
322655.1724,322913.7931,318103.4483,316137.931,318206.8966,328241.3793,320793.1034,306051.7241,329637.931,
327724.1379,329896.5517,325396.5517,326120.6897,321051.7241,278224.1379,249931.0345,246931.0345,248482.7586,
246000,239017.2414,230068.9655,219775.8621,274137.931,229551.7241,224741.3793,227275.8621,225879.3103,
226655.1724,232758.6207,300931.0345,344431.0345,346189.6552,332275.8621,305793.1034,277862.069,260586.2069,
270206.8966,271189.6552,268862.069,265189.6552,258465.5172,260741.3793,251120.6897,239172.4138,218120.6897,
231051.7241,231982.7586,230120.6897,233844.8276,226293.1034,210827.5862,204724.1379,200689.6552,200844.8276,
200586.2069,199913.7931,201000,200741.3793,201775.8621,210724.1379,216103.4483,224431.0345,250086.2069,
223344.8276,242327.5862,256241.3793,261465.5172,245689.6552,231568.9655,218896.5517,266689.6552,306568.9655,
210672.4138,200637.931,202603.4483,202034.4828,200586.2069,200637.931,199448.2759,207672.4138,388706.8966,
390827.5862,390827.5862,391396.5517,391810.3448,390413.7931,390465.5172,384620.6897,380172.4138,354775.8621,
310603.4483,218741.3793,219258.6207,223500,232137.931,241086.2069,244706.8966,253706.8966,301603.4483,
301603.4483,308896.5517,325034.4828,344431.0345,333465.5172,335379.3103,322241.3793];
var property = new Cesium.SampledPositionProperty();
for (var i = 0; i<150; i +=1) {
//var radians = Cesium.Math.toRadians(i);
var time = Cesium.JulianDate.addSeconds(start, i, new Cesium.JulianDate());
var position = Cesium.Cartesian3.fromDegrees(concavex[i],concavey[i],concaveh[i]);
property.addSample(time, position);
}//for var i loop
return property;
}//function computeCircularFlight
//Compute the entity position property.
var position = computeFlight(-92.248, 24.0793, 483065);
//Actually create the entity
var entity = viewer.entities.add({
//Set the entity availability to the same interval as the simulation time.
availability : new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
start : start,
stop : stop
})]),
“name”:“Glider”,
“description” : “\r\n
<img src=‘glider.jpg’ height=‘80’ width=‘150’ scrolling=‘no’ style=‘float:left; margin: 0
1em 1em 0;’ Glider
\r\n
”,
//Use our computed positions
position : position,
//Automatically compute orientation based on position movement.
orientation : new Cesium.VelocityOrientationProperty(position),
//Load the Cesium plane model to represent the entity
model : {
uri : ‘SampleData/models/glider/model.glb’,
minimumPixelSize : 45
}//,
});//var entity
…
[two drop-down lists to select two czml’s at a time …I have a whole bunch of czml’s and I would like one of the selectable czmls to be the glider with its path
and orientation]
…
Sandcastle.reset = function() {
Viewer.dataSources.removeAll(false);
…
On Behalf Of Patrick Cozzi