Page 1 of 1

CesiumJS

Posted: Fri Dec 19, 2014 6:03 am
by zoombear
Hello,

I'm also using Cesium for a personal project. I love how you implemented the navigation control on the map UI. I know there is a Cesium branch trying to implement that:

https://github.com/macoda/cesium/tree/NavigationCamera

But I haven't been able to get it to work in 3D mode like you have it. Can you provide any insight as to how you implemented it?

best,
Vanessa

Re: CesiumJS

Posted: Mon Dec 22, 2014 4:10 pm
by sonal
The code (https://github.com/macoda/cesium/tree/NavigationCamera) works fine after making small changes in NavigationViewModel.js

1) this._ellipsoid.getMaximumRadius() changed to this._ellipsoid.maximumRadius
2) _cameraController._camera to _cameraController
3) center = ray.getPoint(intersection.start, tilt3DCenter) to center = Ray.getPoint(ray,intersection.start)

4) Added variable res
var res = new Cartesian3();
var angle = (minHeight * 0.25) / (Cartesian3.magnitude(Cartesian3.subtract(center, camera.position,res)));

5) if (mode === SceneMode.SCENE3D) Changed to 'else'

6) In Navigation.js
Add viewModel.update(); as last line in function 'setPointerFromMouse'

Hope it helps.