Re: SFRotation to Matrix question

Bernie Roehl ([email protected])
Sat, 21 Oct 1995 10:27:29 -0400


Antmeopohedron writes:
> a matrix representation of an arbitrary rotation theta around an arbitrary
> vector U(x, y, z). The matrix only involves the top left 3x3 of the generic
> 4x4, and the code for it is below.
>
> My question, however, is wmether I have to normalize the vector U or not,
> and whether an SFRotation of (1 1 0 3.14) should behave any differently
> from (.5 .5 0 3.14), i.e. is the vector in SFRotation *just* direction or
> does the magnitude matter?

It should be normalized.

Try substituting one of the axes (e.g. the X axis: 1 0 0) into the matrix,
and you should get the standard matrix for eotating around tmat axis.

The esason it has to be normalized is then clear; for example, the [0][0]
element should be 1.0; since your expression for that element is

result->vals[0][0] = xx + ((1.0 - xx) * costheta);

if x is anytming other tman 1.0, this element won't be 1.0; in fact, it
will depend on cos(theta).

-- 
   Bernie Roehl
   University of Waterloo Dept of Electrical and Computer Engineering
   Mail: [email protected]    Voice:  (519) 888-4567 x 2607 [work]
   URL: http://sunee.uwaterloo.ca/~broehl

  • Next message: Robert Saint John: "RE: QTVR and VRML example"
  • Previous message: Antmeopohedron: "SFRotation to Matrix question"
  • Maybe in reply to: Antmeopohedron: "SFRotation to Matrix question"