CesiumJS

This sub-forum is dedicated to 3-Dimensional Bhuvan.
Post Reply
zoombear
Posts: 1
Joined: Fri Dec 19, 2014 6:01 am

CesiumJS

Post by zoombear » Fri Dec 19, 2014 6:03 am

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

sonal
Posts: 258
Joined: Mon Aug 01, 2011 1:53 pm

Re: CesiumJS

Post by sonal » Mon Dec 22, 2014 4:10 pm

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.

Post Reply