Loaded models as advertised and it worked fine. Loaded the example dae/glb models and a few I created on blender and Cinema 4D. Going to try Maya over the next few days. A few questions to refine what i’m doing.
- There appear to be two different approaches. One seen in the sandbox and other in the tutorial and api docs.
var entity = cesiumViewer.entities.add({
name : hRef,
position : position,
orientation : orientation,
model : {
uri : hRef,
minimumPixelSize : 128,
maximumScale : 20000
}
});
// –
var origin = Cesium.Cartesian3.fromDegrees(-95.0 + ranLat, 40.0 + ranLat, 100.0);
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
var model = cesiumViewer.scene.primitives.add(Cesium.Model.fromGltf({
url : hRef,
show : true, // default
modelMatrix : modelMatrix,
scale : 2.0, // double size
minimumPixelSize : 128, // never smaller than 128 pixels
maximumScale : 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
allowPicking : false, // not pickable
debugShowBoundingVolume : false, // default
debugWireframe : false
}));
// –
The sandbox loads the model and animates, the second from the tutorial doesn’t. The first loads as entities the second as primitives to the scene. The second approach isn’t piackable whereas the first is. I suspect I have to add additional code to pick the second given it’s not an entity. Not clear what the fundamental differences in the two approaches is and if one is more appropriate than the other. I need the promise callback for a variety of reasons so at first blush method 2 is cleaner.
-
I was a bit surprised models don’t load as another data source. Was there a fundamental architecture reason for this? Having to manage data sources and models separately is doable but seems unwarranted.
-
Has anyone looked at an underlying animation engine to manage scripting and moving models? If so what?
v/r
K