Skip to content

Conversation

@PreciousnessX
Copy link

@PreciousnessX PreciousnessX commented Oct 15, 2025

  • Read label attribute using header-derived type and size in binary and binary_compressed
  • Examples (webgl_loader_pcd.html):
    • Add Z-up handling and fit-view camera for Z-up datasets
    • Recreate OrbitControls per up-axis to avoid roll on pitch
    • Colorize points by integer label (deterministic HSL mapping)
    • Hide GUI color control when label-based vertex colors are present
    • Keep legacy behavior for Y-up files; split yUpFiles/zUpFiles

Rationale:

  • Fix mis-parsing of label when its field size/type varies (1/2/4 bytes)
  • Improve out-of-the-box experience for Z-up point clouds
  • Provide visual validation for label attribute via per-label colors

Testing:

  • Ran npm run lint, npm run test-unit, npm run test-unit-addons
  • Manually verified examples:
    • ascii/simple.pcd (Y-up)
    • binary/Zaghetto.pcd (Y-up)
    • binary_compressed/pcl_logo.pcd (Y-up)
    • binary/fusion_lidar_scene.pcd, binary_compressed/lidar_scene.pcd (Z-up)
  • Checked OrbitControls behavior (no roll on pitch in Z-up)

Colorize points by integer label (deterministic HSL mapping):
image

https://raw.githack.com/PreciousnessX/three.js/feature/pcdloader-label-zup/examples/webgl_loader_pcd.html

@mrdoob
Copy link
Owner

mrdoob commented Oct 20, 2025

That 40MB file is too big for the repo... Do you mind removing it from the PR?

@mrdoob mrdoob added this to the r181 milestone Oct 20, 2025
Leon added 3 commits October 20, 2025 12:54
…-based colors

- Read label attribute using header-derived type and size in binary and binary_compressed
Examples (webgl_loader_pcd.html):
- Add Z-up handling and fit-view camera for Z-up datasets
- Recreate OrbitControls per up-axis to avoid roll on pitch
- Colorize points by integer label (deterministic HSL mapping)
- Hide GUI color control when label-based vertex colors are present
- Keep legacy behavior for Y-up files; split file lists (yUpFiles/zUpFiles)
- Update default example to 'binary/fusion_lidar_scene.pcd'
…tation

- Set default example back to 'binary/Zaghetto.pcd'
- Restore Y-up camera initial position to (0, 0, 1)
- Revert OrbitControls maxDistance to 10 for Y-up path
- Keep Z-up path logic for specific datasets (no visual baseline change)
Lint:
- PCDLoader.js: add missing semicolons for label reading (binary/binary_compressed)
- webgl_loader_pcd.html: fix indentation to tabs (ESLint indent rule)
@PreciousnessX PreciousnessX force-pushed the feature/pcdloader-label-zup branch from e42a60a to 9f7d35f Compare October 20, 2025 04:54
@PreciousnessX
Copy link
Author

Hi @mrdoob,

Thanks for the feedback!

File removed: I've removed the fusion_lidar_scene.pcd file from the PR as requested.

controls.update();
camera.updateProjectionMatrix();

}
Copy link
Collaborator

@Mugen87 Mugen87 Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind removing these changes from the demo and just add lidar_scene.pcd as a new asset?

@mrdoob mrdoob modified the milestones: r181, r182 Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants