iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.08k stars 293 forks source link

Orthographic Camera & Point Cloud - Point cloud not updating #2232

Closed Pourfex closed 7 months ago

Pourfex commented 8 months ago

Orthographic camera usage on itowns makes any point cloud added in the scene not updating.

Your Environment

Context

Point cloud layer is not updating if we use orthographic camera (perspective camera work). Don't know if anyone has this use case before. We think it's because of the orthographic camera position which never moves but only "zoom" so point cloud layer has the same position of camera whatever the orthographic camera zoom has.

Steps to Reproduce (for bugs)

Check exemples, zoom on point cloud with orthographic camera view

Expected Behavior

Point cloud layer should update based on zoom.

Actual Behavior

Point cloud layer does not update based on zoom.

Possible Cause/Fix/Solution

We think it's because of the orthographic camera position which never moves but only "zoom" so point cloud layer has the same position of camera whatever the orthographic camera zoom has.

Desplandis commented 8 months ago

I'll investigate this issue.

Desplandis commented 7 months ago

Hi and thanks for your detailed bug report, I managed to easily reproduce this issue on the master branch!

Since we are using an orthographic camera, the position of the camera never changes while zooming, only the zoom property changes. This property factor the top, bottom, right and left planes of the frustrum (but only updates the projection matrix, not the corresponding properties).

Since the point cloud implementation was never used on an orthographic camera context, we will need to:

I have started a branch which "fixes" both issue and I'll soon open a PR, I will tag you for testing! =)

Pourfex commented 7 months ago

Fix with #2242 ! Thanks @Desplandis