-
Notifications
You must be signed in to change notification settings - Fork 44
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
Change the order of QuatRotation
from (w,x,y,z)
to (x,y,z,w)
#210
Comments
In what package is I think the package (which defines |
Its defined in Makie.jl: |
Okay, I found I think we would not like to have an additional method for We have the following choices to solve this problem:
In any case, I think this is not an issue of Rotations.jl. |
With julia> using StaticArrays
julia> v = SVector(1,2,3,4)
4-element SVector{4, Int64} with indices SOneTo(4):
1
2
3
4
julia> v.x,v.w
(1, 4) This is incompatible with julia> using Rotations
julia> q = QuatRotation(1.,0.,0.,0.)
3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(Quaternion{Float64}(1.0, 0.0, 0.0, 0.0, true)):
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
julia> Rotations.params(q)
4-element SVector{4, Float64} with indices SOneTo(4):
1.0
0.0
0.0
0.0
julia> Rotations.params(q).x
1.0 We should change the order of arguments of |
QuatRotation
from (w,x,y,z)
to (x,y,z,w)
I hope JuliaArrays/StaticArrays.jl#980 isn't causing problems here? I guess it has wider consequences than expected (it was meant to be an optional concrete API for doing "normal geometry stuff" with short static vectors...) |
However it fell out, it’s going to be better to make a breaking change here than in StaticArrays… |
Hah, you're right about that, I don't think we can (or really should) take that PR back as I think it's a major usability win for a very common use case. But it's still always a little unnerving adding features to |
At least in my fields of dynamics, aerospace, robotics, and mechanical engineering, it's more standard to have the quaternion ordered as Instead of depending on the change in StaticArrays, could we just define |
Yeah IMO it would probably be good to have direct property access on the rotation rather than going via |
This makes sense to me. Code which knows it's acting on a particular concrete type can just depend on the field names of that type. There's no need to have uniformity/consistency between different concrete types for this use case. |
This will be implemented in #209 and is waiting for some reviews. |
@bjack205 The respective advantages of [w,x,y,z]-order and [x,y,z,w]-order can be summarized as follows: Advantages of [w,x,y,z]-order
Advantages of [x,y,z,w]-order
I personally believe all of the software should be consistent with [w,x,y,z]-order, and consistency with other software is not our No.1 priority. |
To be able to set the orientation of an object in a 3D scene of Makie.jl I use the following code:
This looks overly complicated to me. Can't this be done easier?
The text was updated successfully, but these errors were encountered: