2

Let's presume I have an arbitrary plane, for sake of simplification, centered at (0,0,0), described by coordinates of 4 vertices (and normal if needed).

Is there any way to describe this plane as rotation of the same plane centered at (0,0,0), lying on XY plane. With any possible way of describing 3D rotation, such as Euler angles, axis angle or quaternion, any of them works.

enter image description here

  • You can see at my answer to http://math.stackexchange.com/questions/1167717/transform-a-plane-to-the-xy-plane/1167779#1167779. – Emilio Novati Mar 30 '15 at 18:50

1 Answers1

4

If they're both centred at (0,0,0), it is sufficient to use the (unit) normal vector to parameterize them. The reference plane has normal vector $(0,0,1)$, the other guy's normal vector is generally of the form $(\cos\theta \sin \phi, \sin\theta\sin\phi,\cos\phi)$.

This tells you you need a rotation about $y$-axis by $\theta$, followed by a rotation about the $z$-axis by $\phi$.

(Note that you can calculate these angles given some vector $(x,y,z)$ by solving the equation $(x,y,z)=(\cos\theta \sin \phi, \sin\theta\sin\phi,\cos\phi)$ over the domains $0\leq \theta \leq 2\pi$ and $0\leq \phi \leq \pi$).

co9olguy
  • 907
  • When you say "rotate around axis", do you mean the global XYZ axis, or local axis of the plane, which rotate along with the plane? – user1617735 Mar 30 '15 at 19:46
  • I mean to rotate the entire space about the specified axis (i.e., y- or z- axis). – co9olguy Mar 30 '15 at 19:49
  • So what I did was rotating a plane randomly, then utilized your formulas to calculate theta and phi, then added another plane and rotated the way you suggested. This indeed aligned the planes on two angles, but it seems an additional rotation is needed.

    http://i.imgur.com/1cNnmkk.png

    I suppose I can do it by calculating angle between vectors from plane center to one of the vertices and then rotating the second plane by that angle around local Z axis?

    – user1617735 Mar 31 '15 at 17:12
  • 1
    Yes, the above formula will only align the normal vectors. If you have plane segments (i.e., squares) instead of full planes, you'll need to calculate the angle between two vertices, then rotate about the normal vector by that angle. – co9olguy Apr 01 '15 at 07:49