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

Add extrinsic euler rotations #337

Open
carbotaniuman opened this issue Sep 10, 2022 · 4 comments
Open

Add extrinsic euler rotations #337

carbotaniuman opened this issue Sep 10, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@carbotaniuman
Copy link

Extrinsic rotations can be implemented by calling the intrinsic rotation with the first and last elements swapped and then manually swapping the elements, and would prove useful when interfacing with OpenCV.

EXTRINSIC_XYZ[0] = INTRINSIC_ZYX[2]
EXTRINSIC_XYZ[1] = INTRINSIC_ZYX[1]
EXTRINSIC_XYZ[2] = INTRINSIC_ZYX[0]

@bitshifter bitshifter added the help wanted Extra attention is needed label Sep 11, 2022
@bitshifter
Copy link
Owner

Hi @carbotaniuman , could you provide a bit more details here, I'm not totally clear on what you are asking for.

@carbotaniuman
Copy link
Author

I was looking for extrinsic rotations, which was used for a visualization in the field I was working in. There's basically the extrinsic counterpart to the intrinsic rotations already present https://docs.rs/glam/latest/glam/enum.EulerRot.html, and according to https://pages.github.berkeley.edu/EECS-106/fa21-site/assets/discussions/D1_Rotations_soln.pdf

It turns out that extrinsic rotation is equivalent to an intrinsic rotation by the same angles but with
inverted order of elemental rotations, and vice-versa. Thus, a RPY transformation with roll, pitch, and
yaw angles of (γ, β, α) is equivalent to the ZYX Euler angle rotations of (α, β, γ).

@bitshifter
Copy link
Owner

Speculatively, what might an API for this look like in glam?

@carbotaniuman
Copy link
Author

It would just be adding the new variants to this enum https://docs.rs/glam/latest/glam/enum.EulerRot.html, and handling them in the euler angle conversion code. I'm fairly confident that what I said in the first paragraph was an implementation technique where you map it to the intrinsic one and then swap some params, but it's been years since I looked at this so I don't really remember.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants