Introduce a rotation3D class (somewhat synomnymous of quaternion) #11768
Replies: 3 comments 2 replies
-
The term "Rotation3D" is far less explicit than Quaternion, because there are several approaches to expressing a 3D rotation. You can use Euler angles (simpler but subject to various limitations), but also Quaternions. These are more suited to animation as they aren't subject to gimbal lock. We have numerous math tutorials in the documentation which should make it easier to understand: https://docs.godotengine.org/en/stable/tutorials/math/index.html |
Beta Was this translation helpful? Give feedback.
-
What @Calinou said. What could be done is to use "Rotation3D" as a keyword for Quaternion, though. (I mean the recently introduced functionality that allows searching for stuff under different names/aliases/keywords, whatever they ended up called) |
Beta Was this translation helpful? Give feedback.
-
What I'm concerned with here is the appropriation of 3D rotations by beginners, which I get may not be a main concern. Right now, I think they are drawn to Euler angles by their presence in the editor. I have interacted with people asking for help about their rotations (typically for interpolation). perhaps the documentation didn't help them enough ; perhaps they didn't bother reading it... Their reaction at the mention of quaternions would be something like "what ? I just want a smooth rotation, I don't need this advanced math !". Math anxiety is a thing (according to wikipedia, it's associated to the same brain area as physical trauma ?!), and I read about teaching experiments where the same task would get very different results from children depending on whether it was presented as drawing or geometry. Well, anyway, I'm only speculating that quaternion is a scary name to many, based on a few conversations. I'm afraid the discussions here are more frequented by experienced developers than by beginners who could confirm my hunch. Regardless I'll still argue that these various representations available for 3D rotation all describe the same concept that can be abstracted I may want to apply a rotation to a node or vector, compose rotations, invert rotations, find a rotation bringing an orientation to another, interpolate between rotations... I don't need to know whether internally they are stored as quaternions, orthogonal matrices with a +1 determinant, axis/angle, Euler or anything in order to understand and use these operations (much like, for instance, I can alter the scale of a node even though it's just part of the information stored in the 3x4 matrix that represents its transform, and it is not immediately accessible in that matrix). |
Beta Was this translation helpful? Give feedback.
-
I've been hanging out on the math-help channels of godot discord servers. A recurring difficulty for non-mathematicians working in 3D is handling rotations. However well-written the documentation page that explains why Euler angles should most of the times not be used, many people tend to stick to them for a sad reason : the name Quaternion seems to be too intimidating. It's a technical math term and will cause many people to run away screaming, despite the many useful functions provided by the engine that supposedly enable people to use quaternions without knowledge of their algebra.
Simply naming the class Rotation3D instead of Quaternion and providing similar methods would likely make it much more beginner friendly.
In fact, although experts are familiar with Quaternions and will expect the class to be named quaternions, should it really be its name ?
The Transform3D class is technically, mathematically speaking, a 3x4 matrix, yet the class isn't named after its implementation but its function. Which I think is wise, because matrix is also the kind of math word that will make people runaway screaming...
I would advocate wrapping the Quaternion class in a Rotation3D class and have both accessible to users, Quaternions remaining for compatibility with existing code (and old school 3D experts), and Rotation3D for the less math-versed users, who would then use quaternions daily without knowing it.
Beta Was this translation helpful? Give feedback.
All reactions