Orthographic Frustum in 3d Scene Mode

468 views
Skip to first unread message

sean.alan...@gmail.com

unread,
Aug 12, 2014, 9:45:23 AM8/12/14
to cesiu...@googlegroups.com, sean.we...@lmco.com
I'm having an issue with changing the frustum in 3D Mode. For some of the things we do, we want to have an Orthographic projection of the globe. As i understand it, I simply change the camera frustum and all should be well. Is this a bug, or am i missing something fundamental in changing the camera frustum and causing this render error? Thanks; code / error is below.

the following code throws the render error in the Cesium Sandcastle for reproducibility.

var widget = new Cesium.CesiumWidget('cesiumContainer');
var canvas = widget.scene.canvas;
var camera = widget.scene.camera;

var radius = 7000000;
var orthoFrustum = new Cesium.OrthographicFrustum();
orthoFrustum.right = radius * Math.PI;
orthoFrustum.left = -orthoFrustum.right;
orthoFrustum.top = orthoFrustum * (canvas.clientHeight / canvas.clientWidth);
orthoFrustum.bottom = - orthoFrustum.top;
orthoFrustum.near = 0.01 * radius;
orthoFrustum.far = 50 * radius;

camera.frustum = orthoFrustum;

I cannot get to the exact error on this machine but the trace is roughly as follows:

Error has occurred while rendering:
RangeError: Invalid array length; frustumCommands in
undateFrustums - > createPotentiallyVisibleSet - > render;

Patrick Cozzi

unread,
Aug 17, 2014, 8:49:38 PM8/17/14
to cesiu...@googlegroups.com, sean.we...@lmco.com, sean.alan...@gmail.com
Hi,

This is not something we have tried.  What are your use cases?  We can write an issue for it.  Currently, parts of the code, like coordinate transforms in shaders, assume perspective division so this will require some core Cesium changes.

Patrick

sean.alan...@gmail.com

unread,
Aug 18, 2014, 9:48:15 AM8/18/14
to cesiu...@googlegroups.com, sean.we...@lmco.com, sean.alan...@gmail.com
Hi Patrick,

Typically we use this type of view for undistorted area views on a globe. Such as a sensor footprint projections near the pole or near the equator. We have found that sometimes reviewers instantly look an othropraphic 2D map (which would be the other option for showing more area) and get stuck on the distortions between equal area shapes located at different latitude on the globe.

Perspective views are fine for this also, but they do clip the amount of area you can see based on an arbitrary height.

Patrick Cozzi

unread,
Aug 18, 2014, 10:00:38 AM8/18/14
to cesiu...@googlegroups.com, sean.we...@lmco.com, sean.alan...@gmail.com
Thanks for the use cases.  I submitted issue #2069.  This is not something I expect us to address in the short-term, but if you are already working with someone at AGI, you could ping them to try to up the priority.

Patrick

Patrick Cozzi

unread,
Feb 21, 2017, 8:45:25 PM2/21/17
to cesium-dev, sean.we...@lmco.com, sean.alan...@gmail.com
Hi Sean,

We just added an orthographic projection option accessible via a new widget in the upper right if you have the time to do some testing: #5021

Patrick
Reply all
Reply to author
Forward
0 new messages