I'm working on an app that will plot out WWII submarine patrol reports. So far, Cesium's been an absolute pleasure to work with, but I've run into a bit of a problem that I'm hoping someone could give me a hand with.
I've plotted out the routes with a polyline that offers the awesome "followSurface" property. This is really useful, because the patrols go back and forth across the Pacific Ocean, and there is sometimes about a month between points.
I've got a 3D submarine model rendered on the map that I'd like to have following the path. I've got it working almost perfectly, except there doesn't seem to be a followSurface property for the CZML path, causing the model to take a straight line through the center of the ocean (While going underwater is a thing subs tend to do, this isn't ideal for showing the position.)
I can interpolate points myself, but then I have to balance between processing power/bandwidth/Database storage and resolution: 100/1000 intermediate points vs. 2 points... I was hoping there would be a way to make the path an arc instead of a straight line.
Thanks in advance for any help!
What I've got now:
...
var builtInCzml = [{
"id" : "document",
"version" : "1.0",
"clock" : {
"interval" : "1942-02-03T16:00:00Z/1942-02-03T16:04:00Z",
"currentTime" : "1942-02-03T16:00:00Z",
"multiplier" : 1,
"range" : "LOOP_STOP",
"step" : "SYSTEM_CLOCK_MULTIPLIER"
}
}, {
"id" : "Vehicle",
"availability" : "1942-02-03T16:00:00Z/1942-02-03T16:04:00Z",
"model" : {
"show" : true,
"gltf" : 'js/cesium/models/sub.glb',
},
"label" : {
"fillColor" : {
"rgba" : [255, 255, 0, 255]
},
"font" : "bold 10pt Segoe UI Semibold",
"horizontalOrigin" : "LEFT",
"outlineColor" : {
"rgba" : [0, 0, 0, 255]
},
"pixelOffset" : {
"cartesian2" : [10.0, 0.0]
},
"scale" : 1.0,
"show" : true,
"style" : "FILL",
"text" : "USS Narwhal",
"verticalOrigin" : "CENTER"
},
"position" : {
"interpolationAlgorithm" : "LAGRANGE",
"interpolationDegree" : 1,
"epoch" : "2012-08-04T16:00:00Z",
"cartesian" : [
0, -5509722.586460211, -2151844.221882823, -2378299.9406736423,
18, -5684531.161035097, -2744542.9854255156, -910990.3759759372,
100, -4396545.545638362, -2437044.991071697, 3912790.1338688354,
108, -4171451.1216227254, -2304348.5076655983, 4224994.521149366,
108, -4171451.1216227254, -2304348.5076655983, 4224994.521149366,
132, -3557603.9416444204, -1978781.4385709134, 4893709.012974627,
132, -3543403.8974256907, -1933264.1334437176, 4921932.675781873,
136, -3462736.6795682968, -1899722.395552415, 4991443.492328856,
140, -3532251.61244064, -1853162.7889278433, 4960349.8138794955,
154, -3821779.853707643, -2093808.8053225805, 4641837.924190534,
154, -3821779.853707643, -2093808.8053225805, 4641837.924190534,
226, -5723826.264925561, -2669064.021283511, -889095.0157719625,
236, -5669540.596844369, -2304083.4451725963, -1791032.530913303,
240, -5510109.516997012, -2151995.3391535785, -2377273.4826697796
]
}
}];
var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.load(builtInCzml, 'Sample CZML with 3D model');
viewer.dataSources.add(czmlDataSource);