Intersection of ray and scene's bounding box in 2D

37 views
Skip to first unread message

meer...@gmail.com

unread,
Mar 30, 2020, 3:24:00 AM3/30/20
to cesium-dev

I'm trying to get the point of intersection between a ray and the borders of the screen when in 2D mode. (SceneMode.SCENE2D).
I have created a ray with the point and angle, but I'm having trouble finding a way to intersect it with a rectangle on the XY plane, or to even create this rectangle from the current camera's view.

Generally what I'm trying to achieve is to create a polyline from a given point and an angle, to the edge of the screen.
This polyline should be updated with cesium's change detection.

Any help with my approach (ray and rectangle of the camera) or any other ideas will be welcomed.

Thanks!



Omar Shehata

unread,
Mar 31, 2020, 4:52:40 PM3/31/20
to cesium-dev
You may find this GitHub issue helpful: https://github.com/CesiumGS/cesium/issues/871

There's some links there with code samples about either doing a ray cast or using the scene.pick functions to get the points on the edge of the screen. 
Reply all
Reply to author
Forward
0 new messages