Should I mention that the rotation in perp is anticlockwise? #287
Replies: 6 comments 2 replies
-
As you point out, whether it is anticlockwise or not depends on the coordinate system the user is using. glam is coordinate system agnostic. If they are using X right and Y up rotation would be counter clockwise, if X right and Y down it would be clockwise. Users could be using either a left or right hand coordinate system, glam doesn't force any particular convention. For this reason glam cannot make assumptions about the perceived direction of rotation. |
Beta Was this translation helpful? Give feedback.
-
https://pressbooks.library.upei.ca/statics/chapter/right-hand-rule/ has a bit of an explanation about co-ordinate system and rotation handedness, glam doesn't enforce any particular convention. |
Beta Was this translation helpful? Give feedback.
-
So you're going to just continue not saying which of the two possible behaviors it is? |
Beta Was this translation helpful? Give feedback.
-
Rather than thinking about it in terms of up or down, couldn't this be described as counter-clockwise around the positive y-axis? |
Beta Was this translation helpful? Give feedback.
-
@makoConstruct No, I can think of 4 possible conventions:
If you have a fixed co-ordinate system then it is easy to explain rotation direction, so for pretty much anyone using glam they will have a fixed coordinate system they are using which is easy to explain. This crate however cannot make any assumptions about the coordinate system being used. It is difficult to explain rotation order in a way that generalises to all possible use cases that is succinct (there are many rotation functions, if glam is to document rotation direction it needs to be done everywhere, consistently) and easy to understand (not much point writing docs that are not clear).
Rotation is on the XY plane, so around the Z axis. I agree with @aloucks with regards to avoiding talking about coordinate systems (e.g. what is up or down) in the docs. I think the easiest way to document rotation methods would to not touch on coordinate systems at all and simply provide examples.
Users can translate that into whatever co-ordinate system they are using and it should make sense. |
Beta Was this translation helpful? Give feedback.
-
Moved this to a discussion as per https://github.com/bitshifter/glam-rs/blob/main/CONTRIBUTING.md. |
Beta Was this translation helpful? Give feedback.
-
I guess whether it's anticlockwise or not depends on whether the user is treating y as being up or down, and that varies, so maybe we can't say a thing like that? But for me, it would have been helpful if it'd said anticlockwise.
Should it just say explicitly "anticlockwise (iff y is up and x is right)"
Beta Was this translation helpful? Give feedback.
All reactions