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

Specifying a flyTo pitch of -90 degrees causes crazy flights #2468

Closed
mramato opened this issue Feb 4, 2015 · 1 comment
Closed

Specifying a flyTo pitch of -90 degrees causes crazy flights #2468

mramato opened this issue Feb 4, 2015 · 1 comment

Comments

@mramato
Copy link
Contributor

mramato commented Feb 4, 2015

Run the below example. With the 2000 range value it goes crazy. Change it to 0 and everything works nicely.

var viewer = new Cesium.Viewer('cesiumContainer');

var entity = viewer.entities.add({
    position : Cesium.Cartesian3.fromDegrees(-95.0, 40.0),
    ellipse : {
        semiMajorAxis : 500.0,
        semiMinorAxis : 500.0,
        material : Cesium.Color.WHITE
    }
});

viewer.flyTo(entity, {
    offset: new Cesium.HeadingPitchRange(0, -Math.PI / 2, 2000)
});

Here's a similar issue that is probably the same bug

var viewer = new Cesium.Viewer('cesiumContainer');

var latitude = 40.0;
var longitude = -100.0;
var north = latitude + .35;
var south = latitude - .35;
var east = longitude + 1.55;
var west = longitude - 1.55;
var rectangle = Cesium.Rectangle.fromDegrees(west, south, east, north);

var entity = viewer.entities.add({
    rectangle : {
        coordinates : rectangle,
        material : './static/Cesium_Logo_Color.jpg'
    }
});

viewer.flyTo(entity, {
    offset : new Cesium.HeadingPitchRange(0, -Math.PI / 2)
});
@WarpDrive
Copy link

Slightly offsetting pitch avoids the rolling flips

viewer.flyTo(entity, {
    offset: new Cesium.HeadingPitchRange(0, (-Math.PI / 2)+0.0000001, 2000)
});
viewer.flyTo(entity, {
    offset : new Cesium.HeadingPitchRange(0, (-Math.PI / 2)+0.0000001)
});

camera.direction doesn't have a horizontal component with vertical pitch, so there isn't really a heading of the direction vector in this case. Although I noticed in the new heading get code that the heading of the up vector is used instead when pitch is vertical.

@pjcozzi pjcozzi mentioned this issue Feb 5, 2015
19 tasks
@bagnell bagnell mentioned this issue Jun 22, 2015
4 tasks
@pjcozzi pjcozzi closed this as completed Jun 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants