Skip to content

[BUG FIX] Correct -Z orientation & vertex color#1540

Merged
duburcqa merged 3 commits intoGenesis-Embodied-AI:mainfrom
ceasor-mao:fix-issue-1516
Aug 12, 2025
Merged

[BUG FIX] Correct -Z orientation & vertex color#1540
duburcqa merged 3 commits intoGenesis-Embodied-AI:mainfrom
ceasor-mao:fix-issue-1516

Conversation

@ceasor-mao
Copy link
Contributor

@ceasor-mao ceasor-mao commented Aug 11, 2025

Description

  1. _np_z_up_to_R now re-computes the orthogonal basis using the world X-axis as a fallback when the first cross-product is near-zero, guaranteeing a correct rotation matrix for all directions.
  2. Pass color argument into create_cylinder

Related Issue

Resolves #1516

Motivation and Context

  1. _np_z_up_to_R in file utils/geom.py returned the identity matrix when the target vector was anti-parallel to the reference up axis, losing the required 180° rotation.
  2. create_linein file utils/mesh.pygenerated a cylinder but never applied the requested color.

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.

@ceasor-mao
Copy link
Contributor Author

Should the same fallback-axis strategy be propagated to other rotation-matrix utilities in the codebase?

@duburcqa
Copy link
Collaborator

Should the same fallback-axis strategy be propagated to other rotation-matrix utilities in the codebase?

Yes, this is necessary.

@duburcqa duburcqa enabled auto-merge (squash) August 12, 2025 04:10
@duburcqa duburcqa merged commit b4feff4 into Genesis-Embodied-AI:main Aug 12, 2025
18 checks passed
YilingQiao pushed a commit to YilingQiao/Genesis that referenced this pull request Aug 22, 2025
…1540)

* Handle -Z direction correctly when z is parallel to up axis
* Add missing vertex colors in utils.mesh.create_line

---------

Co-authored-by: Alexis DUBURCQ <alexis.duburcq@gmail.com>
winnieyangwannan pushed a commit to winnieyangwannan/Genesis that referenced this pull request Sep 14, 2025
…1540)

* Handle -Z direction correctly when z is parallel to up axis
* Add missing vertex colors in utils.mesh.create_line

---------

Co-authored-by: Alexis DUBURCQ <alexis.duburcq@gmail.com>
Kashu7100 pushed a commit to Kashu7100/Genesis that referenced this pull request Jan 26, 2026
…1540)

* Handle -Z direction correctly when z is parallel to up axis
* Add missing vertex colors in utils.mesh.create_line

---------

Co-authored-by: Alexis DUBURCQ <alexis.duburcq@gmail.com>
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.

[Bug]: draw_debug_line draws wrongly

2 participants