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

Fix inertial transformation #39

Open
astrojuanlu opened this issue Oct 28, 2019 · 1 comment
Open

Fix inertial transformation #39

astrojuanlu opened this issue Oct 28, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@astrojuanlu
Copy link
Member

(Asked in the Cesium forum)

When enabling the icrf function on the JavaScript side implemented here:

// To have an inertial (ICRF) view
function icrf(scene, time) {{
var icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
if (Cesium.defined(icrfToFixed)) {{
var camera = viewer.camera;
var offset = Cesium.Cartesian3.clone(camera.position);
var transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
camera.lookAtTransform(transform, offset);
}}
}}
// Temporarily disable inertial view
// until we make it work with 2D Mercator view
// and fix the zoom sensitivity, see
// https://groups.google.com/d/msg/cesium-dev/vuXmepd4T2E/i71tq2I8EAAJ
// viewer.scene.postUpdate.addEventListener(icrf);

There are some strange effects when rotating the view or switching to 2D. We should try to fix those.

@astrojuanlu
Copy link
Member Author

We already have a potential solution proposed by @OmarShehata:

I think you may need to detect and disable the inertial frame logic when the camera is morphing and/or when it's in 2D view. You can listen to the morph event here:

https://cesium.com/docs/cesiumjs-ref-doc/Scene.html?classFilter=scene#morphStart

And detect whether it's in 2D/3D here:

https://cesium.com/docs/cesiumjs-ref-doc/Scene.html?classFilter=scene#mode

@astrojuanlu astrojuanlu added the bug Something isn't working label Oct 28, 2019
@Sedictious Sedictious self-assigned this May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants