Smooth camera when tracking an entity

253 views
Skip to first unread message

Aaron Bird

unread,
May 9, 2015, 5:39:20 PM5/9/15
to cesiu...@googlegroups.com
Hi

I know this has probably come up a few times in different ways, but I am attempting to "smoothly" follow an entity along a path with the camera, whilst keeping the camera quite natural.

I followed the sandbox example and can track an entity along a path (easy enough), but the camera doesn't seem very natural. i.e. its fixed above the entity.

The doarama camera is much more natural looking and I am looking to achieve something similar.  I'm not sure what components I would need to achieve something similar.

Any help would be great

Thanks

Hyper Sonic

unread,
May 10, 2015, 4:40:57 PM5/10/15
to cesiu...@googlegroups.com
I haven't looked at the Doarama's code, but observing the movement it seems to do something like this:

The farther away a property value is from it's target value the faster the camera travels to this target value.
There's a target range that you can alter with mouse-wheel. 
Target heading is the heading from camera to entity. 
Target pitch seems to be somewhere in the neighborhood of say -10 to -30 degrees pitch.

Also when paused it slowly rotates the camera around the surface normal at the entity to keep it lively.

I believe it is custom tracking code not part of Cesium, probably executed via .onTick or .preRender.

The info window is quite sophisticated as well; you can drag it around via the title bar or resize it by dragging a side or a corner, and click the photo to swap (3d to small window, photo to large window.)

Narco

unread,
May 11, 2015, 2:57:28 AM5/11/15
to cesiu...@googlegroups.com
I also like Doarama's camera.

I have a question regarding camera, how to allow the camera to rotate below the surface ? (As sometimes i need view model closely from below)

Hyper Sonic

unread,
May 11, 2015, 9:51:29 AM5/11/15
to cesiu...@googlegroups.com
viewer.scene.screenSpaceCameraController.minimumZoomDistance = -300 will let you go 300 meters under the surface, though you'll see terrain skirt grids while underground.

Lu Yiheng

unread,
May 11, 2015, 10:28:42 AM5/11/15
to cesiu...@googlegroups.com
Thanks Hyper Sonic !

Hyper Sonic <gman...@gmail.com>于2015年5月11日星期一写道:
viewer.scene.screenSpaceCameraController.minimumZoomDistance = -300 will let you go 300 meters under the surface, though you'll see terrain skirt grids while underground.

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/z7YWVS73Y94/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Bird

unread,
May 11, 2015, 3:28:55 PM5/11/15
to cesiu...@googlegroups.com
Thanks Hyper,

It does seem quite advanced.  I'll  map out what I am trying to achieve and list the steps based on what you have said.  Would be great to have something like this bundled into cesium :-) 
Reply all
Reply to author
Forward
0 new messages