Search code examples
javascript3ddata-visualizationcesiumjs

Get Camera's Rectangle position from CesiumJS


I am having trouble to get Rectangle position of current Camera view.

I want to create a Rectangle or Wall on the same position as current Camera view (red rectangle). Is there any way to do this?

enter image description here

Thank you


Solution

  • I am not sure I understand you problem, but I think you may have luck using the the Cesium camera's computeViewRectangle function to get the approximate rectangle the camera can see.

    Here is the documentation: https://cesiumjs.org/Cesium/Build/Documentation/Camera.html#computeViewRectangle