Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make coordinates in point cloud chunks independent from scene origin #58948

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

wonder-sk
Copy link
Member

Until now, coordinates of chunks of point clouds were using "world" coordinates, i.e. they were relative to the 3D scene origin point. As a part of preparation for large scene support (QEP 301), we need coordinates inside chunks to be independent from the scene origin point. For each point cloud chunk, we pick origin point as a corner of the chunk's 3D box, which should guarantee that coordinates within chunk (floats) will have reasonable numerical precision.

I have also used the opportunity to simplify the code that handles point cloud chunk coordinates: rather than having flipped coordinates (x,-z,y) inside chunks, we are using map coordinates without flipping (x,y,z), only relative to the origin point of the chunk. The flipping of axes is handled by QTransform attached to each chunk. (Hopefully when all chunked entity implementations get updated, we will be able to remove all the axis flipping everywhere by just removing the rotation in associated QTransforms.)

There's also a fix for a crash, when point cloud uses coloring based on classification and triangulation is enabled (the pointSize array was not getting populated for parent nodes).

If point cloud rendering uses triangulation, the chunk loader
now may get cancelled before triangulation actually starts.
(So if e.g. user changes 3d renderer's properties, the refresh is faster)
Until now, coordinates of chunks of point clouds were using "world" coordinates,
i.e. they were relative to the 3D scene origin point. As a part of preparation
for large scene support (QEP qgis#301), we need coordinates inside chunks to be
independent from the scene origin point. For each point cloud chunk, we pick
origin point as a corner of the chunk's 3D box, which should guarantee that
coordinates within chunk (floats) will have reasonable numerical precision.

I have also used the opportunity to simplify the code that handles point cloud
chunk coordinates: rather than having flipped coordinates (x,-z,y) inside chunks,
we are using map coordinates without flipping (x,y,z), only relative to the origin
point of the chunk. The flipping of axes is handled by QTransform attached
to each chunk. (Hopefully when all chunked entity implementations get updated,
we will be able to remove all the axis flipping everywhere by just removing
the rotation in associated QTransforms.)

There's also a fix for a crash, when point cloud uses coloring based on classification
and triangulation is enabled (the pointSize array was not getting populated for parent
nodes).
@wonder-sk wonder-sk added 3D Relates to QGIS' 3D engine or rendering Point Clouds labels Oct 2, 2024
@github-actions github-actions bot added this to the 3.40.0 milestone Oct 2, 2024
Copy link

github-actions bot commented Oct 2, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 2ff7c52)

Copy link

github-actions bot commented Oct 2, 2024

Tests failed for Qt 6

One or more tests failed using the build from commit bc40b15

pointcloud_3d_colorramp (testPointCloudAttributeByRamp)

pointcloud_3d_colorramp

Test failed at testPointCloudAttributeByRamp at tests/src/3d/testqgspointcloud3drendering.cpp:316

pointcloud_3d_classification (testPointCloudClassification)

pointcloud_3d_classification

Test failed at testPointCloudClassification at tests/src/3d/testqgspointcloud3drendering.cpp:353

The full test report (included comparison of rendered vs expected images) can be found here.

Further documentation on the QGIS test infrastructure can be found in the Developer's Guide.

@wonder-sk wonder-sk merged commit 6853c3c into qgis:master Oct 3, 2024
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3D Relates to QGIS' 3D engine or rendering Point Clouds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants