0
$\begingroup$

Example: If I have a line rotated (at its center) by -45 degress on the x, y, and z axis what formula would I used to determine what angle that object is at if you put it back on a cartesian plane?

The higher level version is css transforms. Rotating is made easy but to handle mouse drag events I need to know what direction (on a cartesian plane) the object is pointing.

  • 0
    Note that rotation in 3D is not commutative. That is, rotating about $x$ then $y$ then $z$ is not the same as say rotating about $z$ then $y$ then $x$, or rotating in any other order. (This is why CSS transforms don't allow you to directly specify angles for $x$, $y$ and $z$ in a single `rotate3d` command; that would be meaningless.) What you are asking for is ambiguous unless you specify the order in which these rotations are performed.2012-12-26

1 Answers 1

1

I would just use three-dimensional rotation matrices acting on a 3-d vector (where you start of assuming z=0), followed by dropping the z-coordinate. They should be easy to code (if they're not already pre-packaged) and would give you more flexibility. That's what the programmers would do when I worked on video games back in the day.