1. A concise explanation of the problem you’re experiencing.
I need to flyTo a gltf model. I want the resulting view to be fairly up close, so I was trying to use the boundingSphere of the entity/modelGraphics. Maybe I’m missing something, but I haven’t found an easy way to do this. Do I need to create a ModelVisualizer from the dataSourceDisplay property of the viewer?
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
Sample code based upon one of the sandcastle demos online:
**// **myEntity.model is defined and loaded with a gltf model
var entityView = new Cesium.EntityView( myEntity, cesium.scene );
cesium.camera.viewBoundingSphere( entityView.boundingSphere, new Cesium.HeadingPitchRange( 0.5, -0.2, entityView.boundingSphere.radius * 4.0 ) );
cesium.camera.lookAtTransform( Cesium.Matrix4.IDENTITY );
// entityView.boundingSphere is undefined after creating the EntityView?
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Fly the camera to ModelGraphics.
4. The Cesium version you’re using, your operating system and browser.
**Cesium 1.41, Windows 10, Chrome **Version 63.0.3239.132 (Official Build) (64-bit)