Setting Pitch

146 views
Skip to first unread message

Brian Behling

unread,
Apr 1, 2019, 12:40:44 PM4/1/19
to cesiu...@googlegroups.com
Hello.

When I set pitch for a default view using camera.setView, the map is no longer centered as defined by the destination property.

How do I change the pitch so the map is centered on the destination point?

--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021

Brian Behling

unread,
Apr 2, 2019, 1:49:48 PM4/2/19
to cesiu...@googlegroups.com

Karl Tian

unread,
Apr 3, 2019, 4:38:20 AM4/3/19
to cesium-dev
This is because Cesium move to camera to right above your center point then start to pitch the camera, so the desired destination will move, sometimes out of screen.
I, too, hope Cesium could do something about that.

在 2019年4月2日星期二 UTC+8上午12:40:44,Brian Behling写道:

Omar Shehata

unread,
Apr 3, 2019, 11:55:45 AM4/3/19
to cesium-dev
I've run into something similar before, where flyTo would tilt and cause an entity that was supposed to be tracked to go out of view:


Notice that for entity to stay in view when you change the pitch, the camera position needs to change. camera.setView will set the camera's position and orientation exactly as given. Ideally what we want is something that'll tell the camera to look at a certain point, with a given orientation. This is what the camera.lookAt is for:


Here's a Sandcastle example where you can change the pitch and it should still be looking at that roof:


I changed the position for the camera to be the actual position on the ground for the camera to focus on (using scene.pickPosition on a mouse click). Let me know if this solves your issue! 

Brian Behling

unread,
Apr 4, 2019, 3:11:53 PM4/4/19
to cesiu...@googlegroups.com
The problem with camera.lookAt is that we can't navigate around the globe any more. The camera is constrained to the position value.

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Omar Shehata

unread,
Apr 5, 2019, 2:50:30 PM4/5/19
to cesium-dev
Ah yes, I didn't realize that. You can unlock the camera again by resetting the transform:

viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);

But it will still keep it in the same position. Does that work for you?
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brian Behling

unread,
Apr 8, 2019, 5:55:24 PM4/8/19
to cesiu...@googlegroups.com
Hey yeah, that will work!

Thanks Omar

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brian Behling

unread,
Apr 8, 2019, 6:10:12 PM4/8/19
to cesiu...@googlegroups.com
Well, for this example, lookAt doesn't work. It moves the camera north.

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=bVNfb9owEP8qJ16aSJlDSEjpStEQnTSkdkOUbZqUF+Mc1KtjI9uhZVW/+y4EttIteYh9vrvfn3PieGak9jBRpi5huYOZNSsGM/RoYawU6ggmRtXVUnL4quUWrZN+B3OzNF4KBzd8yeBOcK2lXjcNxgp/cl1aAwtrhDBKAm3hlnuUMJFGcKskskJvuYWtxEcCugKNjzBBJ+uKfdvHgjOx306M9lxqtGcRPBca6CFqlkLEdCtLqn5/rBQWCeW7sapctDlBWOiX8LLQzdsAeqnQoT9FbD/p9aI9DJ6htupP16nRc3SmtgLZyppq7ChnWgZJnvWSEPbtWx3MCdTINlZW0pNVjvGyDA6QLYuGw8aQhdLoNyS49bTiOg2Sbr836PbZRZ4mWZqc5xHkSS/PsoylWTro5r2LLIIk62VpmrNskPfPB4PBxSsigldoOVPGPIx9cASMoDXwn+cVjU/IS5rkTHpxP+d6jUE3Op7RDO+ZN3PK4NoF77J+GEG/Gx6kHaFJpGNGCyXFA2lc1Vo06AFuUfvwMMWDEXR+6h3VzA50g/+502vbsKcI2sVuD08dhdHOKCTR60ZxE305JfbKk4UlBStjq+CvNiufMja9/vh5MV38CC87UWfo/E7hqHXtg6w2xvrmbgSMxR6rjaLr5uJlLR7QM+H2mMP4WDQs5RZkeVV03lzlogNCcefoZFUrdSd/YdEZDWPKPylTZj+LL/TTKb5rUu6T0U0bZIwNY9oeq34D

Is should be centered like this:

Omar Shehata

unread,
Apr 10, 2019, 9:32:07 AM4/10/19
to cesium-dev
This is actually the same issue as before, where the point you're looking at is not on the ground. I clicked the point on the ground, and replaced the position with it in the first example, and it should look right now:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=bVNtb9owEP4rJ74skTKHBBKalVZDdNKQug1RtmlSvhjnaL06NrIdWlb1v+9CYCvdnEix7+157jknjudGag9TZZoKVjuYW7NmMEePFiZKoY5galRTrySHr1pu0Trpd7AwK+OlcHDNVwxuBNda6tu2wEThT64ra2BpjRBGSaAjfOIeJUylEdwqiazUW25hK/GBgC5A4wNM0cmmZt/2tuCN2B+nRnsuNdo3ETyVGmgRNUsmYrqVFWW/O2YKi4Ty3VhVLbuYICz1c3he6vZpAb1U6NCfInafwdWycwZP0Fj1p+rM6AU601iBbG1NPXEUM6uCJB+mSQj78l0fzAnUyDZW1tKTVI7xqgoOkB2LlsPGkITS6FckuPW043oQJP0sHeUJy7IiT0ZFPysiyJOU3oIleXaWFkk/jyAZpsM0H7FhUZxlRVKMBi+oCF6j5UwZcz/xwREygk7Cf9YLIh+RVzTLufTibsH1LQb96OijKd4xbxYUwbUL3g6zMIJBvx8eujtiU5+OGS2UFPfU5rrRooUPcIvah4dBHrQg/6l8lDM/8A3+J1DalWGPEXSb3R6eKgqjnVFIXd+2LbfW51NiL0RZWmphbWwd/G3Oyschm119+LycLX+E572oN3Z+p/Cyk+29rDfG+vZ6BIzFHuuNohvn4lUj7tEz4faY4/iYNK7kFmR1UfZe3eayB0Jx58izbpS6kb+w7F2OY4o/SVNmP4wv9N8pvmtD7pLL687IGBvHdDxm/QY
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021

Brian Behling

unread,
Apr 10, 2019, 4:31:10 PM4/10/19
to cesiu...@googlegroups.com
We can't change the cartesian position to offset the camera angle. This point is going to be dynamic, and it's going to be the centroid of various sized polygons. 

Isn't there a way to simply set the camera angle along an arc, like what the behavior of click and mouse drag, so the camera is always pointed at the position, without having to offset the position coordinates?

To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021



--

Brian Behling

Software Engineer 3 | CEC

10368 Westmoor Dr, Westminster, CO 80021

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages