0

I've been struggling to calculate the rotationX, rotationY and rotationZ (CSS transform) from origin to a point in 3d space. The 3d point can be seen as a vector with the length 1 starting from origin (0,0,0) to (x,y,z). I'm basically trying to calculate the pitch, yaw and roll of a vector.

It's similar like the unit circle with a third dimension. But instead of the angle t, I'm looking for the rotation around each axis unit circle

I've been trying this solution but I seem to miss something: How to convert direction vector to euler angles?

Thanks,

Eric

Community
  • 1
  • 1
  • Just knowing the initial and final positions of a _single_ point is not enough - you also need the pivot point (the center of rotation) –  Aug 01 '16 at 15:35
  • To clarify: x, y, z is positioned on the surface of a sphere with radius 1. So x, y and z is always between -1 and 1. – Eric Jacobsson Aug 01 '16 at 15:38
  • The center of rotation is (0,0,0). You can think of it as rotating a sphere. – Eric Jacobsson Aug 01 '16 at 15:40
  • So you have initial _and_ final x, y, z ? If so what are you missing exactly? –  Aug 01 '16 at 15:45
  • Exactly! The rotation around each axis (rotation around x-axis, y-axis, and z-axis). Need that to rotate a dom element accordingly with a CSS-transform – Eric Jacobsson Aug 01 '16 at 16:49
  • But what are you _missing_? You said there was something –  Aug 01 '16 at 17:04
  • I'm looking for the pitch, roll and jaw for the vector from origin to a point (x, y and z). Like this: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Yaw_Axis_Corrected.svg/2000px-Yaw_Axis_Corrected.svg.png – Eric Jacobsson Aug 02 '16 at 07:38

0 Answers0