NCSA Portfolio

ncsa.j3d
Class SimpleTransformGroup

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.Node
              |
              +--javax.media.j3d.Group
                    |
                    +--javax.media.j3d.TransformGroup
                          |
                          +--ncsa.j3d.SimpleTransformGroup
Direct Known Subclasses:
PickableTransformGroup

public class SimpleTransformGroup
extends javax.media.j3d.TransformGroup

This class is designed to represent a node that moves through space. It can have rotate and translate operations applied to it easily and dynamically.

Scaling, translation, and rotation are applied in an intuitive order. For example, upon doing a rotate the group will only rotate and will not change absolute location.


Fields inherited from class javax.media.j3d.TransformGroup
ALLOW_TRANSFORM_READ, ALLOW_TRANSFORM_WRITE
 
Fields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICK, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
SimpleTransformGroup()
          Initializes the transform to the identity transform.
SimpleTransformGroup(javax.vecmath.Vector3f initial)
          The constructor can accept a Vector3f as an initial translation that will be applied even after the object has been reset.
 
Method Summary
 javax.vecmath.Vector3d get()
          This method allows getting the translational component.
 void get(double[] array)
          This method allows getting the matrix in array form.
 void get(javax.media.j3d.Transform3D transform)
          This method allows getting the Transform.
 void move(javax.vecmath.Vector3d v)
          This method adds to the transformational component of the transform.
 void move(javax.vecmath.Vector3f v)
          This method adds to the transformational component of the transform.
 void reset()
          This method returns the Transform to its original(default) state.
 void rotX(double angle)
          This method applies a rotation(cumulative) about the x axis.
 void rotY(double angle)
          This method applies a rotation(cumulative) about the y axis.
 void rotZ(double angle)
          This method applies a rotation(cumulative) about the z axis.
 void scale(double scale)
          This method applies a scaling(cumulative).
 void scale(javax.vecmath.Vector3d scale)
          This method applies a non-uniform scale
 void set(double[] array)
          This method allows setting of the matrix directly.
 void set(SimpleTransformGroup stg)
          This method sets its internal Transform to the Transform of the argument.
 void set(javax.media.j3d.Transform3D transform)
          Allows the setting of the matrix with a Transform3D.
 void set(javax.vecmath.Vector3d vector)
          Allows setting the translational component without affecting the rotation.
 void set(javax.vecmath.Vector3d vec, double x, double y, double z)
          This method allows all of the transformational components and rotational components to be set absolutely.
 
Methods inherited from class javax.media.j3d.TransformGroup
cloneNode, duplicateNode, getTransform, setTransform
 
Methods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, insertChild, moveTo, numChildren, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTransformGroup

public SimpleTransformGroup(javax.vecmath.Vector3f initial)
The constructor can accept a Vector3f as an initial translation that will be applied even after the object has been reset.
Parameters:
initial - Is a Vector3f.

SimpleTransformGroup

public SimpleTransformGroup()
Initializes the transform to the identity transform.
Parameters:
none -  
Method Detail

reset

public void reset()
This method returns the Transform to its original(default) state. it maintains the transformation applied in the constructor (if any).
Parameters:
none -  

set

public void set(SimpleTransformGroup stg)
This method sets its internal Transform to the Transform of the argument.
Parameters:
SimpleTransformGroup - the stg we want to be like.

set

public void set(javax.media.j3d.Transform3D transform)
Allows the setting of the matrix with a Transform3D.
Parameters:
transform - The transform to set this node to.

set

public void set(javax.vecmath.Vector3d vec,
                double x,
                double y,
                double z)
This method allows all of the transformational components and rotational components to be set absolutely.

This is useful when a device is controling a SimpleTransform and works in absolute coordinates.

Parameters:
Vector3d - The translational component.
double - The x rotation.
double - The y rotation.
double - The z rotation.

set

public void set(double[] array)
This method allows setting of the matrix directly.
Parameters:
array - An array of 16 doubles to be the new Transform3D.

set

public void set(javax.vecmath.Vector3d vector)
Allows setting the translational component without affecting the rotation.
Parameters:
vector - the new translational component.

get

public javax.vecmath.Vector3d get()
This method allows getting the translational component.
Parameters:
none -  
Returns:
The vector3d that is the translation.

get

public void get(double[] array)
This method allows getting the matrix in array form.
Parameters:
array - A double[16] to accept the matrix.

get

public void get(javax.media.j3d.Transform3D transform)
This method allows getting the Transform.
Parameters:
transform - The transform to receive the new transform.

move

public void move(javax.vecmath.Vector3f v)
This method adds to the transformational component of the transform.
Parameters:
v - The Vector3f object that describes the move.

move

public void move(javax.vecmath.Vector3d v)
This method adds to the transformational component of the transform.
Parameters:
v - The Vector3d object that describes the move.

rotX

public void rotX(double angle)
This method applies a rotation(cumulative) about the x axis.
Parameters:
angle - The angle in radians to rotate by.

rotY

public void rotY(double angle)
This method applies a rotation(cumulative) about the y axis.
Parameters:
angle - The angle in radians to rotate by.

rotZ

public void rotZ(double angle)
This method applies a rotation(cumulative) about the z axis.
Parameters:
angle - The angle in radians to rotate by.

scale

public void scale(double scale)
This method applies a scaling(cumulative).
Parameters:
scale - The scale to apply.

scale

public void scale(javax.vecmath.Vector3d scale)
This method applies a non-uniform scale
Parameters:
scale - The scale vector to apply.

NCSA Portfolio

NCSA Portfolio, Copyright 1997-1999, National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, All Rights Reserved