Comments (5)
Thanks @bitshifter !
from glam-rs.
Ah right, handedness has confused me a bit at points. I guess looking at https://www.evl.uic.edu/ralph/508S98/coordinates.html it's more about the convention than what is going on in the math.
from glam-rs.
If you felt like rewording it I'd be happy to accept a PR. Otherwise I will get to it sometime.
from glam-rs.
For what it's worth, I found the documentation helpful and hope that it's not removed. Wouldn't the angles need to be negated if the rotations were following the right-hand rule?
from glam-rs.
Wouldn't the angles need to be negated if the rotations were following the right-hand rule?
I don't think so, only for a function like from_rotation_ypr
which bakes in a notion of coordinate systems (see #79). If you look at the images on https://www.evl.uic.edu/ralph/508S98/coordinates.html rotating unit +Z +90 degrees around +Y will result in unit +X. This is true for both left-handed and right-handed systems. While conceptually in the left-handed system positive rotation is clockwise and in the right-handed system positive rotation is counter-clockwise, mathematically they are the same.
I think that is what @emilk was getting at.
Code wise:
use glam::{Mat3, Vec3};
// rotate +z 90 degrees around y giving +x
let m = Mat3::from_rotation_y(90.0_f32.to_radians());
let v = m * Vec3::unit_z();
assert!(v.abs_diff_eq(Vec3::unit_x(), core::f32::EPSILON));
from glam-rs.
Related Issues (20)
- Vec2::fract() with negative numbers is inconsistent with f32::fract() HOT 5
- Quat::to_euler outputs bigger than PI * 2 at certain angles HOT 13
- Possible Incompleteness HOT 1
- Quat::from_euler truncates rotations to a single rotation HOT 2
- Multiply BVecN and VecN? Implement Into/From for BVecN to VecN with 1.0:s and 0.0:s HOT 1
- Quat / Euler tests fail on Apple Silicon HOT 11
- IVec2 and similar types should be Ord. HOT 1
- Extend `.normalize()` etc. to work for more values HOT 2
- Vec2/3's `angle_between` function is unclear/misleading HOT 16
- Vec2 clamp_length alters vector when length is within specified range HOT 5
- Mutable Swizzles HOT 3
- Inconsistent/missing scalar implementation of le/ge functions for Vec3A compared to sse2 HOT 2
- Any ambitions to implement static comma vectors? HOT 1
- impl From<Vec4> for Vec3A violates conversion is lossless contract
- Batched transforms
- Add methods for swing-twist decomposition to `Quat` HOT 2
- Add helper function to project one vector to a plane HOT 5
- Add `fast_normalize` to `Quat` (and maybe other types) HOT 5
- Feature flag for repr(C) Quat HOT 8
- Make `Vec3A::from_vec4` const HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glam-rs.