-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make coordinates in point cloud chunks independent from scene origin #58948
Conversation
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).
Tests failed for Qt 6One or more tests failed using the build from commit bc40b15 pointcloud_3d_colorramp (testPointCloudAttributeByRamp)pointcloud_3d_colorrampTest failed at testPointCloudAttributeByRamp at tests/src/3d/testqgspointcloud3drendering.cpp:316
pointcloud_3d_classification (testPointCloudClassification)pointcloud_3d_classificationTest 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. |
This is a continuation of work started in qgis#58948, handling all the cases of data from vector layers.
This is a continuation of work started in qgis#58948, handling all the cases of data from vector layers.
This is a continuation of work started in #58948, handling all the cases of data from vector layers.
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).