camera.costrainedAxis ==> An error occurred while rendering. Rendering has stopped.

24 views
Skip to first unread message

daniel...@gmail.com

unread,
Sep 13, 2019, 9:09:58 AM9/13/19
to cesium-dev
1. A concise explanation of the problem you're experiencing.
I'm trying to limit the tilt of the camera (not too near the ground), so I'm using camera.costrainedAxis.
I did some test to understand how it work but I get the error:

An error occurred while rendering. Rendering has stopped.
TypeError: Cannot read property 'southwest' of undefined
TypeError: Cannot read property 'southwest' of undefined


2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

viewer.scene.camera.constrainedAxis = new Cesium.Cartesian3(45, 45, 45); // just for test


3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

When tilting, to limit the height of the camera from the ground in 3d mode, because
1) I don't want to see the horizon
2) often times the camera goes under the ground


4. The Cesium version you're using, your operating system and browser.

1.61

Omar Shehata

unread,
Sep 13, 2019, 11:20:18 AM9/13/19
to cesium-dev
I think the constrained axis has to be a unit cartesian, so you might need to normalize it. 

There's an example using it in the camera Sandcastle:


Click "set camera reference frame" to see what it's doing there. Let me know if you find that helpful. 
Reply all
Reply to author
Forward
0 new messages