| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Shape3D javax.media.j3d.OrientedShape3D
All known Subclasses: org.jdesktop.j3dedit.scenegrapheditor.visualtools.PointHighlightShape3D,
OrientedShape3D | public class OrientedShape3D extends Shape3D (Code) | | The OrientedShape3D leaf node is a Shape3D node that is oriented
along a specified axis or about a specified point. It defines an
alignment mode and a rotation point or axis. This will cause
the local +z axis of the object to point at the viewer's eye
position. This is done regardless of the transforms above this
OrientedShape3D node in the scene graph. It optionally defines a
scale value along with a constant scale enable flag that causes
this node to be scale invariant, subject only to its scale.
OrientedShape3D is similar in functionality to the Billboard
behavior, but OrientedShape3D nodes will orient themselves
correctly for each view, and they can be used within a SharedGroup.
If the alignment mode is ROTATE_ABOUT_AXIS, then the rotation will be
around the specified axis. If the alignment mode is
ROTATE_ABOUT_POINT, then the rotation will be about the specified
point, with an additional rotation to align the +y axis of the
TransformGroup with the +y axis in the View.
If the constant scale enable flag is set, the object will be drawn
the same size in absolute screen coordinates (meters), regardless
of the following: any transforms above this OrientedShape3D node in
the scene graph, the view scale, the window scale, or the effects
of perspective correction. This is done by scaling the geometry
about the local origin of this node, such that 1 unit in local
coordinates is equal to the number of meters specified by this
node's scale value. If the constant scale enable flag is set to
false, then the scale is not used. The default scale is 1.0
meters.
OrientedShape3D nodes are ideal for drawing screen-aligned text or
for drawing roughly-symmetrical objects. A typical use might
consist of a quadrilateral that contains a texture of a tree.
Note that in a multiple View system, picking and interestion test
is done with the primary View only.
See Also: Billboard since: Java 3D 1.2 |
Field Summary | |
final public static int | ALLOW_AXIS_READ Specifies that this OrientedShape3D node
allows reading its alignment axis information. | final public static int | ALLOW_AXIS_WRITE Specifies that this OrientedShape3D node
allows writing its alignment axis information. | final public static int | ALLOW_MODE_READ Specifies that this OrientedShape3D node
allows reading its alignment mode information. | final public static int | ALLOW_MODE_WRITE Specifies that this OrientedShape3D node
allows writing its alignment mode information. | final public static int | ALLOW_POINT_READ Specifies that this OrientedShape3D node
allows reading its rotation point information. | final public static int | ALLOW_POINT_WRITE Specifies that this OrientedShape3D node
allows writing its rotation point information. | final public static int | ALLOW_SCALE_READ Specifies that this OrientedShape3D node
allows reading its scale and constant scale enable information. | final public static int | ALLOW_SCALE_WRITE Specifies that this OrientedShape3D node
allows writing its scale and constant scale enable information. | final public static int | ROTATE_ABOUT_AXIS Specifies that rotation should be about the specified axis. | final public static int | ROTATE_ABOUT_POINT Specifies that rotation should be about the specified point and
that the children's Y-axis should match the view object's Y-axis. | final public static int | ROTATE_NONE Specifies that no rotation is done. |
Constructor Summary | |
public | OrientedShape3D() Constructs an OrientedShape3D node with default parameters. | public | OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Vector3f axis) Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, and axis.
The specified axis must not be parallel to the Z
axis--(0,0,z) for any value of z. | public | OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Point3f point) Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, and rotation point. | public | OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Vector3f axis, boolean constantScaleEnable, double scale) Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, axis, constant scale
enable flag, and scale
The specified axis must not be parallel to the Z
axis--(0,0,z) for any value of z. | public | OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Point3f point, boolean constantScaleEnable, double scale) Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, and rotation point. |
Method Summary | |
public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode OrientedShape3DRetained object that this
OrientedShape3D object will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all Shape3D information from
originalNode into
the current node. | public void | duplicateNode(Node originalNode, boolean forceDuplicate) Copies all node information from originalNode into
the current node. | public void | getAlignmentAxis(Vector3f axis) Retrieves the alignment axis of this OrientedShape3D node,
and copies it into the specified vector. | public int | getAlignmentMode() Retrieves the alignment mode. | public boolean | getConstantScaleEnable() Retrieves the constant scale enable flag. | public void | getRotationPoint(Point3f point) Retrieves the rotation point of this OrientedShape3D node,
and copies it into the specified vector. | public double | getScale() Retrieves the scale value for this OrientedShape3D. | public void | setAlignmentAxis(Vector3f axis) Sets the new alignment axis. | public void | setAlignmentAxis(float x, float y, float z) Sets the new alignment axis. | public void | setAlignmentMode(int mode) Sets the alignment mode. | public void | setConstantScaleEnable(boolean constantScaleEnable) Sets the constant scale enable flag. | public void | setRotationPoint(Point3f point) Sets the new rotation point. | public void | setRotationPoint(float x, float y, float z) Sets the new rotation point. | public void | setScale(double scale) Sets the scale for this OrientedShape3D. |
ALLOW_AXIS_READ | final public static int ALLOW_AXIS_READ(Code) | | Specifies that this OrientedShape3D node
allows reading its alignment axis information.
|
ALLOW_AXIS_WRITE | final public static int ALLOW_AXIS_WRITE(Code) | | Specifies that this OrientedShape3D node
allows writing its alignment axis information.
|
ALLOW_MODE_READ | final public static int ALLOW_MODE_READ(Code) | | Specifies that this OrientedShape3D node
allows reading its alignment mode information.
|
ALLOW_MODE_WRITE | final public static int ALLOW_MODE_WRITE(Code) | | Specifies that this OrientedShape3D node
allows writing its alignment mode information.
|
ALLOW_POINT_READ | final public static int ALLOW_POINT_READ(Code) | | Specifies that this OrientedShape3D node
allows reading its rotation point information.
|
ALLOW_POINT_WRITE | final public static int ALLOW_POINT_WRITE(Code) | | Specifies that this OrientedShape3D node
allows writing its rotation point information.
|
ALLOW_SCALE_READ | final public static int ALLOW_SCALE_READ(Code) | | Specifies that this OrientedShape3D node
allows reading its scale and constant scale enable information.
since: Java 3D 1.3 |
ALLOW_SCALE_WRITE | final public static int ALLOW_SCALE_WRITE(Code) | | Specifies that this OrientedShape3D node
allows writing its scale and constant scale enable information.
since: Java 3D 1.3 |
ROTATE_ABOUT_POINT | final public static int ROTATE_ABOUT_POINT(Code) | | Specifies that rotation should be about the specified point and
that the children's Y-axis should match the view object's Y-axis.
See Also: OrientedShape3D.setAlignmentMode |
ROTATE_NONE | final public static int ROTATE_NONE(Code) | | Specifies that no rotation is done. The OrientedShape3D will
not be aligned to the view.
See Also: OrientedShape3D.setAlignmentMode since: Java 3D 1.3 |
OrientedShape3D | public OrientedShape3D()(Code) | | Constructs an OrientedShape3D node with default parameters.
The default values are as follows:
alignment mode : ROTATE_ABOUT_AXIS
alignment axis : Y-axis (0,1,0)
rotation point : (0,0,1)
constant scale enable : false
scale : 1.0
|
OrientedShape3D | public OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Vector3f axis)(Code) | | Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, and axis.
The specified axis must not be parallel to the Z
axis--(0,0,z) for any value of z. It is not
possible for the +Z axis to point at the viewer's eye
position by rotating about itself. The target transform will
be set to the identity if the axis is (0,0,z).
Parameters: geometry - the geometry component with which to initializethis shape node Parameters: appearance - the appearance component of the shape node Parameters: mode - alignment mode, one of: ROTATE_ABOUT_AXIS,ROTATE_ABOUT_POINT, or ROTATE_NONE Parameters: axis - the ray about which the OrientedShape3D rotates |
OrientedShape3D | public OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Point3f point)(Code) | | Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, and rotation point.
Parameters: geometry - the geometry component with which to initializethis shape node Parameters: appearance - the appearance component of the shape node Parameters: mode - alignment mode, one of: ROTATE_ABOUT_AXIS,ROTATE_ABOUT_POINT, or ROTATE_NONE Parameters: point - the position about which the OrientedShape3D rotates |
OrientedShape3D | public OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Vector3f axis, boolean constantScaleEnable, double scale)(Code) | | Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, axis, constant scale
enable flag, and scale
The specified axis must not be parallel to the Z
axis--(0,0,z) for any value of z. It is not
possible for the +Z axis to point at the viewer's eye
position by rotating about itself. The target transform will
be set to the identity if the axis is (0,0,z).
Parameters: geometry - the geometry component with which to initializethis shape node Parameters: appearance - the appearance component of the shape node Parameters: mode - alignment mode, one of: ROTATE_ABOUT_AXIS,ROTATE_ABOUT_POINT, or ROTATE_NONE Parameters: axis - the ray about which the OrientedShape3D rotates Parameters: constantScaleEnable - a flag indicating whether to enableconstant scale Parameters: scale - scale value used when constant scale is enabled since: Java 3D 1.3 |
OrientedShape3D | public OrientedShape3D(Geometry geometry, Appearance appearance, int mode, Point3f point, boolean constantScaleEnable, double scale)(Code) | | Constructs an OrientedShape3D node with the specified geometry
component, appearance component, mode, and rotation point.
Parameters: geometry - the geometry component with which to initializethis shape node Parameters: appearance - the appearance component of the shape node Parameters: mode - alignment mode, one of: ROTATE_ABOUT_AXIS,ROTATE_ABOUT_POINT, or ROTATE_NONE Parameters: point - the position about which the OrientedShape3D rotates Parameters: constantScaleEnable - a flag indicating whether to enableconstant scale Parameters: scale - scale value used when constant scale is enabled since: Java 3D 1.3 |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
cloneNode should be overridden by any user subclassed
objects. All subclasses must have their cloneNode
method consist of the following lines:
public Node cloneNode(boolean forceDuplicate) {
UserSubClass usc = new UserSubClass();
usc.duplicateNode(this, forceDuplicate);
return usc;
}
Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode OrientedShape3DRetained object that this
OrientedShape3D object will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all Shape3D information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
duplicateNode | public void duplicateNode(Node originalNode, boolean forceDuplicate)(Code) | | Copies all node information from originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
For any NodeComponent objects
contained by the object being duplicated, each NodeComponent
object's duplicateOnCloneTree value is used to determine
whether the NodeComponent should be duplicated in the new node
or if just a reference to the current node should be placed in the
new node. This flag can be overridden by setting the
forceDuplicate parameter in the cloneTree
method to true .
NOTE: Applications should not call this method directly.
It should only be called by the cloneNode method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: ClassCastException - if originalNode is not an instance of Shape3D See Also: Node.cloneTree See Also: Node.cloneNode See Also: NodeComponent.setDuplicateOnCloneTree |
getAlignmentAxis | public void getAlignmentAxis(Vector3f axis)(Code) | | Retrieves the alignment axis of this OrientedShape3D node,
and copies it into the specified vector.
Parameters: axis - the vector that will contain the alignment axis exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
getAlignmentMode | public int getAlignmentMode()(Code) | | Retrieves the alignment mode.
one of: ROTATE_ABOUT_AXIS, ROTATE_ABOUT_POINT,or ROTATE_NONE exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
getConstantScaleEnable | public boolean getConstantScaleEnable()(Code) | | Retrieves the constant scale enable flag.
the current constant scale enable flag exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
getRotationPoint | public void getRotationPoint(Point3f point)(Code) | | Retrieves the rotation point of this OrientedShape3D node,
and copies it into the specified vector.
Parameters: point - the point that will contain the rotation point exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
getScale | public double getScale()(Code) | | Retrieves the scale value for this OrientedShape3D.
the current scale value exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setAlignmentAxis | public void setAlignmentAxis(Vector3f axis)(Code) | | Sets the new alignment axis. This is the ray about which this
OrientedShape3D rotates when the mode is ROTATE_ABOUT_AXIS.
The specified axis must not be parallel to the Z
axis--(0,0,z) for any value of z. It is not
possible for the +Z axis to point at the viewer's eye
position by rotating about itself. The target transform will
be set to the identity if the axis is (0,0,z).
Parameters: axis - the new alignment axis exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setAlignmentAxis | public void setAlignmentAxis(float x, float y, float z)(Code) | | Sets the new alignment axis. This is the ray about which this
OrientedShape3D rotates when the mode is ROTATE_ABOUT_AXIS.
The specified axis must not be parallel to the Z
axis--(0,0,z) for any value of z. It is not
possible for the +Z axis to point at the viewer's eye
position by rotating about itself. The target transform will
be set to the identity if the axis is (0,0,z).
Parameters: x - the x component of the alignment axis Parameters: y - the y component of the alignment axis Parameters: z - the z component of the alignment axis exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setAlignmentMode | public void setAlignmentMode(int mode)(Code) | | Sets the alignment mode.
Parameters: mode - alignment mode, one of: ROTATE_ABOUT_AXIS,ROTATE_ABOUT_POINT, or ROTATE_NONE exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setConstantScaleEnable | public void setConstantScaleEnable(boolean constantScaleEnable)(Code) | | Sets the constant scale enable flag.
Parameters: constantScaleEnable - a flag indicating whether to enableconstant scale exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
setRotationPoint | public void setRotationPoint(Point3f point)(Code) | | Sets the new rotation point. This is the point about which the
OrientedShape3D rotates when the mode is ROTATE_ABOUT_POINT.
Parameters: point - the new rotation point exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setRotationPoint | public void setRotationPoint(float x, float y, float z)(Code) | | Sets the new rotation point. This is the point about which the
OrientedShape3D rotates when the mode is ROTATE_ABOUT_POINT.
Parameters: x - the x component of the rotation point Parameters: y - the y component of the rotation point Parameters: z - the z component of the rotation point exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setScale | public void setScale(double scale)(Code) | | Sets the scale for this OrientedShape3D. This scale is used when
the constant scale enable flag is set to true.
Parameters: scale - the scale value exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
|
|