Rendering stops when camera.pitch is positive

Working with code below, when by rotating a view camera.pitch becomes positive- rendering stops.

@import url("../api/Build/Cesium/Widgets/widgets.css"); html, body, #cesiumContainer { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; background-color: white }

``

It has nothing to do with skyBox: false and globe: false.

In my case, it will be enough to prevent user to rotate view under terrain, so please advice me how to do it.

I tried with:

viewer.camera.changed.addEventListener(function () {

if (viewer.camera.pitch >= 0) {

viewer.camera.setView({ orientation: { pitch: Cesium.Math.toRadians(-10.0) } })

}

});

``

But rendering also stops, so it may not be linked to camera.pitch only…

Cesium 1.44 - 2018-04-02
Google Chrome
Version 67.0.3396.99 (Official Build) (64-bit)

Windows 10 Pro 1709

More info:
if camera.pitch=0.0 then error occurs:

Cesium.js:235150 An error occurred while rendering. Rendering has stopped.

undefined

DeveloperError: normalized result is not a number

Error

at new DeveloperError (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:540:19)

at Function.Cartesian3.normalize (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:3845:19)

at pan3D (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:219106:24)

at spin3D (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:218971:17)

at reactToInput (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:218042:21)

at update3D (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:219560:9)

at ScreenSpaceCameraController.update (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:219595:13)

at Scene.initializeFrame (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:225011:43)

at CesiumWidget.render (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:235198:25)

at render (http://localhost/inetec/api/Build/CesiumUnminified/Cesium.js:234579:32)

Dana petak, 6. srpnja 2018. u 15:52:24 UTC+2, korisnik Alen Kelemen napisao je:

Even more info :slight_smile:
I reproduce the same error in sandbox : https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=CZML%20Box.html&label=CZML

Just move camera direction near box, under and rotate up…

Dana petak, 6. srpnja 2018. u 15:52:24 UTC+2, korisnik Alen Kelemen napisao je:

Hey Alen,

I’m having a hard time reproducing the exact error. I think I was able to reproduce a related but different error. I got this by starting on the cube in the example you provide, picking a point on it, holding the middle mouse button, and moving my mouse in clockwise circles on the view for a few seconds:

An error occurred while rendering. Rendering has stopped.
undefined
DeveloperError: normalized result is not a number
Error
at new DeveloperError (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:540:19)
at Function.Cartesian3.normalize (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:8132:19)
at rotateVertical (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:186217:28)
at Camera.rotateUp (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:186208:9)
at rotate3D (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:231295:20)
at tilt3DOnEllipsoid (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:231534:9)
at tilt3D (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:231476:13)
at reactToInput (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:230287:21)
at update3D (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:231807:9)
at ScreenSpaceCameraController.update (https://cesiumjs.org/Cesium/Build/CesiumUnminified/Cesium.js:231840:13)

Notice how mine is an error in rotateVertical, whereas yours is in pan3D. Can you describe a bit more how exactly you’re triggering this?

Just copy js part of my code in sandbox:

var czml = [{

“id”: “document”,

“version”: “1.0”

},

{

“id”: “1”,

“polygon”: {

“positions”: {

“cartographicDegrees”: [29.059, 44.3189, 15, 29.059, 44.3192, 15, 29.05995, 44.3193, 15, 29.0599, 44.3190, 15]

},

extrudedHeight: 50

}

}];

var viewer = new Cesium.Viewer(‘cesiumContainer’,

{

skyBox: false,

globe: false,

});

var p = Cesium.CzmlDataSource.load(czml);

p.then(function ® { console.log® })

viewer.dataSources.add§;

viewer.zoomTo§;

``

and then rotate the cube using ctrl & left mouse button and move cursor up , so cube will rotate… and rendering stops when bottom plane of the cube become visible

Dana petak, 6. srpnja 2018. u 20:23:10 UTC+2, korisnik Omar Shehata napisao je:

Thanks for following up Alen. I think it’s a bug with Cesium’s camera not handling the case when the camera is at the origin. I’ve opened up an issue so that the Cesium maintainers can look at it here:

Feel free to add any more detail/comments there, or follow the issue to see how it progresses.