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

to euler angles #68

Closed
bitshifter opened this issue Aug 17, 2020 · 4 comments
Closed

to euler angles #68

bitshifter opened this issue Aug 17, 2020 · 4 comments
Labels
discussion Feedback from users about this proposal is desired enhancement New feature or request

Comments

@bitshifter
Copy link
Owner

I have seen some people wanting to extract euler angles from Quaternion and Matrix rotations. Then I've seen others disparaging them for using euler angles. Euler angles are commonly used in editors and while we can create glam rotations from euler angles there's currently no support for going the other way. I don't want to encourage using euler angles where they aren't appropriate but there might be legitimate use cases where providing this functionality would be appropriate.

@bitshifter bitshifter added discussion Feedback from users about this proposal is desired enhancement New feature or request labels Aug 17, 2020
@John-Nagle
Copy link

Yes. There's pub fn from_rotation_ypr(yaw: f32, pitch: f32, roll: f32) -> Self but not the reverse operation. If you have one, you should have both, and they should be symmetrical.

@CAD97
Copy link
Contributor

CAD97 commented Mar 7, 2021

See also #79; ypr functionality isn't coordinate agnostic. It is a good idea for however this ends up being handled eventually to be symmetric, though.

@mickare
Copy link
Contributor

mickare commented Apr 12, 2021

Hey, I made a pull-request #163 to add conversion between intrinsic Euler rotation sequences and Quaternions.

In the PR, only the three-axis sequences (e.g. YXZ - yaw pitch roll) are tested fully.
The two-axis conversions (e.g. ZxZ) are sometimes ambiguous and cannot be tested with my generic test implementation. Those are marked as deprecated until someone has a nice test for them. Until then, use with caution (also marked as deprecated)!

Usage

let q = Quat::from_euler(EulerRot::YXZi, 0.3, 0.1, 0.0);
let (y, x, z) = q.to_euler(EulerRot::YXZi);  // the "i" indicates intrinsic

bitshifter pushed a commit that referenced this issue Apr 14, 2021
* add euler rotation sequence conversion #68
@bitshifter
Copy link
Owner Author

Thanks @mickare !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Feedback from users about this proposal is desired enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants