var Cesium = require('cesium/Cesium');
require('./css/main.css');
require('cesium/Widgets/widgets.css');
var viewer = new Cesium.Viewer('cesiumContainer');
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(
Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 2000.0));
var model = viewer.scene.primitives.add(Cesium.Model.fromGltf({
url : 'data/Model2.glb',
modelMatrix : modelMatrix,
scale : 20000.0
}));
viewer.zoomTo(model);
var viewer = new Cesium.Viewer('cesiumContainer');
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame( Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 2000.0));
var model = viewer.scene.primitives.add(Cesium.Model.fromGltf({
url : '../../SampleData/models/CesiumAir/Cesium_Air.glb',
modelMatrix : modelMatrix, scale : 20000.0}));
viewer.zoomTo(model);
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/eiqFheT2284/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cesium-dev/a7f19231-9452-4cdd-8db2-3157451bda00%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
Glad to hear that worked!
What kind of project are you working on?
On Wednesday, August 28, 2019 at 8:11:51 AM UTC-4, Nicolas Derouineau wrote:
Thanks, I thought that viewer.zooTo was equivalent to viewer.camera.zoomTo. Thanks for the feedback !
On Tue, Aug 27, 2019 at 7:36 PM Omar Shehata <omar.sam...@gmail.com> wrote:
This is actually not a problem not an issue with webpack. You'll see the same error if you try it in Sandcastle:
var viewer = new Cesium.Viewer('cesiumContainer');var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-75.62898254394531, 40.02804946899414, 2000.0));var model = viewer.scene.primitives.add(Cesium.Model.fromGltf({url : '../../SampleData/models/CesiumAir/Cesium_Air.glb',modelMatrix : modelMatrix,scale : 20000.0}));viewer.zoomTo(model);
The problem is the viewer.zoomTo method does not take a model. You could try passing in the position of the model and offset, with the viewer.camera.flyTo or viewer.camera.zoomTo methods, or use an Entity which will allow you to just do viewer.zoomTo(model) like in this example:
Let me know if that helps.
To unsubscribe from this group and all its topics, send an email to cesiu...@googlegroups.com.