You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Load the code into Sandcastle and try looking at the model from below.
Camera can't be put lower than 12.6 meters.
varpoint={lon: -2.434,lat: -0.248}// Case 1// { lon: -2.137, lat: 0.66 } // Case 2;varviewer=newCesium.Viewer('cesiumContainer',{baseLayerPicker: false,terrainProvider: newCesium.CesiumTerrainProvider({url : '//cesiumjs.org/tilesets/terrain/smallterrain'})});viewer.scene.globe.depthTestAgainstTerrain=trueviewer.camera.flyTo({destination : Cesium.Cartesian3.fromRadians(point.lon,point.lat,100),duration: 0});// put the model at terrain heightCesium.sampleTerrain(viewer.terrainProvider,11,[viewer.camera.positionCartographic.clone()]).then(function(cartographic){varalt=cartographic[0].height||0console.log(alt)varczml=newCesium.CzmlDataSource()czml.load([{id: "document",version: "1.0"},{position: {cartographicRadians: [point.lon,point.lat,alt]},model: {gltf: '../../SampleData/models/CesiumAir/Cesium_Air.gltf'}}])viewer.dataSources.add(czml)})// to monitor camera heightsetInterval(function(){console.log(viewer.camera.positionCartographic.height)},3000)
In "Case 2" (un-comment line 3) terrain height is -32.4 but camera can't be put lower than -12.6 m (again! now negative).
"Case 2" also illustrates #2271 - when camera height becomes negative terrain and sky disappear.
Also got an exception several times while manipulating the camera with middle mouse button pressed:
An error occurred while rendering. Rendering has stopped.
RangeError: Invalid array length
RangeError: Invalid array length
at updateFrustums (http://cesiumjs.org/Cesium/Source/Scene/Scene.js:821:36)
at createPotentiallyVisibleSet (http://cesiumjs.org/Cesium/Source/Scene/Scene.js:971:13)
at render (http://cesiumjs.org/Cesium/Source/Scene/Scene.js:1373:9)
at Scene.render (http://cesiumjs.org/Cesium/Source/Scene/Scene.js:1413:13)
at CesiumWidget.render (http://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:641:25)
at render (http://cesiumjs.org/Cesium/Source/Widgets/CesiumWidget/CesiumWidget.js:68:32)
The text was updated successfully, but these errors were encountered:
When in the camera's default mode, the closest you can get to the terrain is specified by the viewer.scene.screenSpaceCameraController.minimumZoomDistance property. I believe it defaults to 20 (mainly because of the sky disappearing issue I think).
If you are in a different camera reference frame (i.e. you aren't looking at the center of the earth), you can get as close to whatever you are looking at via the above property as well. The 3D Models example is a good illustration of that (use the combo box and select skinned model). You are only about 1 meter off the ground in that example.
The limitation of 2, is that in this mode we currently don't keep the camera above terrain. (which is on the todo list).
Load the code into Sandcastle and try looking at the model from below.
Camera can't be put lower than 12.6 meters.
In "Case 2" (un-comment line 3) terrain height is -32.4 but camera can't be put lower than -12.6 m (again! now negative).
"Case 2" also illustrates #2271 - when camera height becomes negative terrain and sky disappear.
Also got an exception several times while manipulating the camera with middle mouse button pressed:
The text was updated successfully, but these errors were encountered: