Class TransformFilter

java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.NewAbstractFilter
xj3d.filter.filters.TransformFilter
All Implemented Interfaces:
BinaryContentHandler, ContentHandler, ProtoHandler, RouteHandler, ScriptHandler, StringContentHandler

public class TransformFilter extends NewAbstractFilter
TransformFilter places up to n transforms around an object.

Arguments are:

  • -scale1 x y z,
  • -rotate1 x y z a(radians),
  • -translate1 x y z, or
  • -resetTransforms
We keep looking for scale/rotate/translate params until we run out of them. We don't assume that the user provides all three (scale/rotate/translate) for every transform group. In other words, this is valid:
-scale1 1 2 1 -rotate2 0 1 0 3.1415
For each transform specified add a Transform around the input stream. So the above input would do this:

DEF TRANSFORM_FILTER1 Transform { scale 1 2 1 children [ DEF TRANFORM_FILTER2 Transform { rotation 0 1 0 3.115 children [ .... <original content> ] } ] } ResetTransforms will remove any previous TransformFilter. This will only be detected if first node is a Transform. This allows multiple files to be combined together without error. This will be detected by using a DEF name of TRANSFORM_FILTER*.

Version:
$Revision: 1.0 $
Author:
Alan Hudson