Re: LANG: VRML Transforms

Bernie Roehl ([email protected])
Fri, 6 Oct 1995 11:29:53 -0400


Patrick Sweeney writes:
> What is the order of transformations? I am
> trying to view office.wrl which places a table (Obj_4) using code
> such as:
> TransformSeparator {
> Translation { translation -0.437 0 -1.7 }
> Rotation { rotation 0 1 0 1.5708 }
> USE Obj_4
> }
> My viewer moves the object and then rotates it about the Y axis. VRweb
> apparently rotates the object and then translates it.

VRweb is correct. The transformation are applied "backwards", starting
from the object; the transformation nearest to the object is applied to
it first, followed by the next-nearest one, and so on.

Think of it in terms of matrices: imagine that each transform node produces
a matrix, and that you just multiply them in the order they appear.
Since transforming a vertex is essentially a special case of a matrix
multiply (where one of the matrices happens to be a row vector), it's all
consistent.

In other words,

transformed_vertex = Translation * Rotation * untransformed_vertex

which is the order the nodes appear in the VRML file.

Of course, this really ought to be explicitly stated in the VRML spec.

-- 
   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: Bernie Roehl: "Re: LANG: VRML Transforms"
  • Previous message: Patrick Sweeney: "Re: LANG: VRML Transforms (fwd)"