Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

morphTo2D/3D/ColumbusView: uncaught RangeError in Cesium updateFrustums #319

Closed
shentonfreude opened this issue Nov 8, 2012 · 14 comments
Closed
Assignees

Comments

@shentonfreude
Copy link

Using b10, and now a fresh clone at [86c3e4c] I'm seeing my app hang when I "morph" to a view.

Uncaught RangeError: Invalid array length Cesium.js:53988
updateFrustums Cesium.js:53988
createPotentiallyVisibleSet Cesium.js:54103
Scene.render Cesium.js:54160
tick index.js:497

This worked in my earlier clone, which was probably about b9. My tick() is simple:

    (function tick() {
        scene.render();
        Cesium.requestAnimationFrame(tick);
    }());

It's failing here:

    function updateFrustums(near, far, farToNearRatio, numFrustums, frustumCommandsList) {
        frustumCommandsList.length = numFrustums;
Uncaught RangeError: Invalid array length
        for (var m = 0; m < numFrustums; ++m) {

at this point, numFrustums is NaN so we get a RangeError: Invalid array length

Interestingly, the morph-free to3D(), to2D(), toColumbusView() calls work fine.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 8, 2012

@bagnell I've seen similar problems (not morphing though) where numFrustums is -1, and assigning to the array length throws and exceptions. However, I can't reproduce it. Perhaps this is the same problem.

@kring
Copy link
Member

kring commented Nov 8, 2012

I have seen this as well while working in the terrain branch. In my case, it was caused by one of my bounding spheres literally having NaNs for its center.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 8, 2012

@kring so it was a bug in the terrain code? The bounding sphere either needs to be properly defined or undefined. However, in the later case, performance will suffer.

@kring
Copy link
Member

kring commented Nov 8, 2012

Yes, it was a bug in the terrain code at the time.

@pjcozzi
Copy link
Contributor

pjcozzi commented Nov 8, 2012

Could have been the same bug I saw - about three weeks ago.

@Tomdavid
Copy link

I can duplicate the numFrustums = -1 exception by zooming way, way out. The calculation of numFrustums in Cesium.jar uses Math.log(far/near) and a very large near value and the configured far value results in a negative value for numFrustums. The exception mentioned previously can be avoided by checking for negative numFrustums before calling updateFrustums with an empty frustumCommandsList.

This may just be a symptom. Is there configuration for limiting the zoom for the user? I cannot tell that near and far values are used for limits. This only happens in the extreme case where the zoom is so far out that the earth has completely disappeared. Our user will really have no reason to perform a zoom out to the Milky Way.

(b11 - 12/03/2012)

@ghost ghost assigned bagnell Dec 11, 2012
@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 11, 2012

@Tomdavid I agree that is the issue. @bagnell will look at a fix.

@bagnell can speak to a zoom limit. We have it in an app we are developing so I assume it made it into the recent camera changes.

@bagnell
Copy link
Contributor

bagnell commented Dec 11, 2012

@Tomdavid There are minimumZoomDistance and maximumZoomDistance properties on the CameraController.

@shentonfreude
Copy link
Author

That's when I see it, when I zoom way way out.

I didn't know about the minimum/maximumZoomDistance, but wouldn't know off
hand what to use, what our satellites' maximum orbit could be. I can take
an educated guess, but would like the code to defend itself against stupid
zooms.

Thanks!

On Tue, Dec 11, 2012 at 2:44 PM, Dan Bagnell notifications@github.comwrote:

@Tomdavid https://github.com/Tomdavid There are minimumZoomDistance and
maximumZoomDistance properties on the CameraController.


Reply to this email directly or view it on GitHubhttps://github.com//issues/319#issuecomment-11259216.

@Tomdavid
Copy link

@bagnell b11 does not have a CameraController (or the properties). Is that in a more recent release of Cesium or are you saying you have implemented the CameraController in your app?

@bagnell
Copy link
Contributor

bagnell commented Dec 11, 2012

@Tomdavid The CameraController was part of a branch that was recently merged into master. I don't think it will be as simple as setting a property in b11, but I'll take a look.

@shentonfreude
Copy link
Author

Ohhhh... :-)
Sorry, I spoke to soon. I was just about to dig into the docs and see how
to implement it. I recently started using b11 and searching through the
code, don't see the minimumZoomDistance or any similar limits.

Sorry for jumping the gun and the confusion.

On Tue, Dec 11, 2012 at 4:50 PM, Tomdavid notifications@github.com wrote:

@bagnell https://github.com/bagnell b11 does not have a
CameraController (or the properties). Is that in a more recent release of
Cesium or are you saying you have implemented the CameraController in your
app?


Reply to this email directly or view it on GitHubhttps://github.com//issues/319#issuecomment-11265953.

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 11, 2012

@shentonfreude it will be in b12, which is expected in early January since we release monthly. Master is also considered very stable and many folks pull directly from there.

This was referenced Dec 12, 2012
@bagnell
Copy link
Contributor

bagnell commented Dec 17, 2012

@Tomdavid @shentonfreude Both crashes have been fixed and are in master. I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants