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

Core: OLCesium constructor + camera #8

Closed
klokan opened this issue Jul 17, 2014 · 4 comments
Closed

Core: OLCesium constructor + camera #8

klokan opened this issue Jul 17, 2014 · 4 comments
Milestone

Comments

@klokan
Copy link
Member

klokan commented Jul 17, 2014

Wrapper around Cesium which takes care of the following synchronizations:

From ol3 to cesium (one way) will be synchronized:

Additionally, the cesium interactions (modifying camera position and properties) will also automatically modify the ol.View properties (center, resolution, rotation) -- details in #9.

The constructed object (returned by the ol3cesium factory) will provide additional methods specific for the 3D environment:
.set/getRoll() - in radians as in ol3 - or possibly in degrees?
.set/getTilt() - in radians?
.set/getHeading() - in radians?, this is in fact shortcut for rotation on ol.View
.set/getDistance() - meters - from target of view
.set/getAltitude() - absolute height of camera above ellipsoid in meters

.set/getCenter() - this is in fact shortcut for center on ol.View (but without change of angles) (Update: originally named set/getTarget).
.set/getPosition() - position of camera
.lookAt() - camera stays on same position and is rotated to point at the specified target
all accepting/returning ol.Coordinate

Access to the underlying Cesium.Scene instance for native calls via Cesium API: .getCesiumScene()
Calls on Cesium API are possible but can desynchronize state of ol3 and cesium.

Synchronization from Cesium view set otherwise back to OL3 is implemented only for Camera->View - and is done automatically or by calling .updateView() in #9 (update: originally syncView)

No major modifications of the ol3 are required.
ol3cesium is compiled with Closure Advanced.
Cesium API is called via externs.
In the initial implementation we try to use only exported functions of ol3 api (via externs for complete separation).

User should be by loading 3 js files: ol3, cesium, ol3cesium.

The advanced compilation of ol3 together with the ol3cesium wrapper may be used, if unexterned ol3 methods must be called.
Theoretically an application can be build together with ol3+ol3cesium in advanced mode to produce a single minimized .js file.

Update: the ilustration of Camera interaction:

olcesium-camera

SVG for printed documentation or presentations:
https://gist.github.com/klokan/d703a2cd40ec65a9a3e7
https://rawgit.com/klokan/d703a2cd40ec65a9a3e7/raw/9f2326d1677931b2b4bafa1aa8bfb47aa7222cb8/ol3cesium_camera.svg

@klokan
Copy link
Member Author

klokan commented Aug 6, 2014

To be done:
Camera is moved to .getCamera().
Inside of camera the get/setTarget is renamed to get/setCenter()

Wrapper accept option target accepting element or id of element.
Wrapper has methods .get/setTarget() accepting element or id of element.
(changed in the above specification)

@elemoine
Copy link
Member

elemoine commented Aug 6, 2014

We also decided to remove the ol3cesium factory and replace it with a constructor (name to be defined), for consistency with ol3.

@klokan klokan changed the title Core: ol3cesium factory Core: OLCesium constructor + camera Aug 8, 2014
@klokan
Copy link
Member Author

klokan commented Aug 8, 2014

Illustration added to the specification above.

@klokan
Copy link
Member Author

klokan commented Aug 8, 2014

Implemented, merged via #16 after discussion and review.

As a result of discussion Roll is now disabled and tracked under: #17

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

2 participants