[vtkusers] normals and rotations

Randy Heiland heiland at ncsa.uiuc.edu
Thu Jul 27 12:02:42 EDT 2000


On Jul 26,  4:30pm, Edi wrote:
> Subject: [vtkusers] normals and rotations
> I have a plane arbitrary oriented in space.
>
> Is it possible to get the rotation angles of this plane ?
>
> What is the relation between a plane's normal and the rotation angles (
> in degrees ) ? How to convert between them ?


Or, how does one rotate an arbitrary vector V = (vx,vy,vz) into a desired
unit-axis-vector N?

I'll offer one approach -- appealing to your intuition.

Let N=(0,0,1).  Assume (vx,vy,vz) has its tail at the origin (if not, translate
first).

We can always rotate V into N using at most 2 axis-rotations.

Check: does V lie in the X-Y plane?  (check dot product, V.N =? 0)
If so: rotate V about Z into either the X or Y axis and then do a 90 deg
rotation into N.

If not:
Project V onto the two orthogonal planes containing N; in this example, X-Z and
Y-Z.  Consider V projected onto X-Z: (vx,0,vz).  Calculating the angle theta
this vector makes with N gives us the rotation about Y.  Similarly, V projected
onto Y-Z, (0,vy,vz), yields the rotation about X.

I'll leave the "words" --> VTK up to you :)

--Randy

Here's a low bandwidth graphical aid:

   Y    V
   |  /
   | /
   |/_____ X
  / \
 /   \
Z





More information about the vtkusers mailing list