Skip to content

Instantly share code, notes, and snippets.

@tonio

tonio/index.md Secret

Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonio/750dbc843ef95601c4be to your computer and use it in GitHub Desktop.
Save tonio/750dbc843ef95601c4be to your computer and use it in GitHub Desktop.

Goal:

  • Animate or set a tilt for the Cesium camera, «à la Google Maps». IE keeping the bottom line of the view unchanged.
  • The view has to keep unchanged, if an angle is applied once positive then one negative.
  • It has to work whatever the rotation to the north is (as it can be changed in ol3’s 2D view).

Schema

Input:

  • A cesium scene with a camera positionned from its ol3 equivalent:
    • extent set with viewExtent method,
    • rotation (to the north) set with twistLeft method
  • a angle α (positive/negative) to tilt the view of,
  • a animation duration (in ms, may equals 0 for immediate change).

Code:

  • The code should replace the method setTiltedView in this Gist
  • Current implementation set camera angle with the camera as the origin AND move up/down to simulate the wanted effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment