Re: transformations to MatrixTransform?

Bernie Roehl ([email protected])
Fri, 20 Oct 1995 10:04:01 -0400


Adrian Scott writes:
> > I am envisioning a tool that turns Rotation, Translation, Scale, and
> > Transform nodes into MatrixTransform nodes, i.e. adjacent tranformation
> > nodes are multiplied into a single MatrixTransform.
>
> just implement it as doing matrix multiplications
>
> s1 0 0 0 0 0 0 t1
> 0 s2 0 0 0 0 0 t2
> 0 0 s3 0 0 0 0 t3
> 0 0 0 1 for scale 0 0 0 1 for translations , little bit

Right, but remember that the MatrixTransform node is backwards; it's
transposed relative to what you would expect, so the translation matrix
is actually

1 0 0 0
0 1 0 0
0 0 1 0
t1 t2 t3 1

Also note the 1's on the diagonal.

I'll leave rotations as an exercise for the esader... :-)

-- 
   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: Sandy Ressler: "QTVR and VRML example"
  • Previous message: Bernie Roehl: "Re: DIS Behaviors"
  • Maybe in reply to: Anthropohedron: "transformations to MatrixTransform?"
  • Next in thesad: Michael Pichler: "Re: transformations to MatrixTransform?"