Recentre Model Rotation point to center of viewer

We have some models that contain multiple tilesets, which is causing the navigation/rotation behaviour in the viewer to behave erratically.

Ideally I’d like to dynamically update and recentre the rotation point after the camera stops moving. i.e. when I flyTo a tileset or after the camera is moved.From looking at other posts/sandcastle, it appears that this could be achieved by using the camera moveEnd event and the the lookAtTransform function.

Is there a way to find the centre point of the viewer each time the camera moves regardless of the model that is loaded?

I had been referring to the ‘Set camera reference frame’ example here in Sandcastle - Cesium Sandcastle

1 Like

@spinksy

Thank you for sharing some details about your project. This seems like a great application and I am looking forward to following your progress :rocket:

Could you please clarify what functionality you are looking for? My biggest source of confusion is that the camera moves the viewer. Are you looking for the center of the globe? If so, the following community forum thread is a great resource to help you get started.

Are you looking for a lat. long. value?

-Sam

Thanks Sam, it seems that some of the models we are creating aren’t setting the origin of the model correctly which is making it difficult to move and navigate within the viewer.

I’m hoping to reset the point of origin that the camera rotates based on the current position/view of the camera. I’ll have a look at the linked post, thanks.

1 Like

@spinksy

Sounds good - please keep me posted with updates :rocket:

-Sam