Replies: 1 comment
-
Coordinate translationHonestly, I'm still myself struggling a bit with this, but I think the following might help. Find in the previous table the cell with the
This means you need to go from (x,y,z) to (x,z,y), With matricesYou can do it with vector swizzles, but you may also want a transform. A matrix is an operation on vectors, to go from one 3D vector to another 3D The kind of matrix we need is a rotation matrix, that rotates at exactly 90 You can think of a matrix as a table,
So for our right-handed Z up to left-handed Y up, conversion from earlier, we
Check the RotationYou are right regarding pitch/yaw/roll (I think) it should be a relatively straightforward translation into euler angles, though no idea about which order, I always assume XYZ but it might be wrong in your case. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have some the position and rotation of a camera and actor from Unreal and want to display it in Bevy and I cannot change the input data. Unreal has a left-handed coordinate system with
+z
pointing up,+y
pointing right and+x
pointing into the screen. Bevy is right-handed, with+y
pointing up,+x
pointing right and-z
pointing into the screen.Here's an example of the input data:
Rotation is an Euler rotation, and my assumption is that
pitch
rotates aroundy
,yaw
aroundz
androll
aroundx
.How can I either (a) convert the position and rotation data so that it can be used in Bevy to display some object in the correct position and orientation relative to the camera, or (b) change Bevy's coordinate system so that it matches that used by Unreal?
My preference would be option (a) and I'd ideally like to be able to do something like:
When creating the
EulerRot
, in what order would the rotations need to be applied?Beta Was this translation helpful? Give feedback.
All reactions