com.yobotics.simulationconstructionset
Class LinkGraphics

java.lang.Object
  extended by com.yobotics.simulationconstructionset.LinkGraphics

public class LinkGraphics
extends java.lang.Object

Title: SimulationConstructionSet

Description:

Copyright: Copyright (c) 2000

Company: Yobotics, Inc.

Version:
1.0
Author:
not attributable

Constructor Summary
LinkGraphics()
          Default no-arg constructor.
LinkGraphics(LinkGraphicsDefinition linkGraphicsDefinition)
           
 
Method Summary
 void add3DSFile(java.lang.String fileName)
          Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance.
 void add3DSFile(java.lang.String fileName, javax.media.j3d.Appearance app)
          Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance.
 void add3DSFile(java.net.URL fileURL)
          Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance.
 void add3DSFile(java.net.URL fileURL, javax.media.j3d.Appearance app)
          Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance.
 void addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius)
          Creates an ArcTorus centered on the current coordinate system.
 void addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius, javax.media.j3d.Appearance arcTorusApp)
          Creates an ArcTorus centered on the current coordinate system with the specified appearance.
 void addBranchGroup(javax.media.j3d.BranchGroup branchGroup)
          Adds the specified BranchGroup to the origin of the current coordinate system.
 void addCone(double height, double radius)
          Adds a cone with the given height and radius centered on the origin of the current coordinate system.
 void addCone(double height, double radius, javax.media.j3d.Appearance coneApp)
          Adds a cone with the given height, radius and appearance centered on the origin of the current coordinate system.
 void addCoordinateSystem(double length)
           
 void addCoordinateSystem(double length, javax.media.j3d.Appearance arrowAppearance)
           
 void addCoordinateSystem(double length, javax.media.j3d.Appearance xAxisAppearance, javax.media.j3d.Appearance yAxisAppearance, javax.media.j3d.Appearance zAxisAppearance, javax.media.j3d.Appearance arrowAppearance)
          Creates a graphical representation of the x, y, and z axis of the current coordinate system centered at its origin.
 void addCube(double lx, double ly, double lz)
          Adds a solid black cube with the specified dimensions centered around the origin of the current coordinate system.
 void addCube(double lx, double ly, double lz, javax.media.j3d.Appearance cubeApp)
          Adds a solid cube with the given dimensions and appearance centered on the origin of the current coordinate system.
 void addCylinder(double height, double radius)
          Adds a soild cylinder with the given radius and height centered on the origin of the current coordinate system.
 void addCylinder(double height, double radius, javax.media.j3d.Appearance cylApp)
          Adds a soild cylinder with the given radius, height and appearance centered on the origin of the current coordinate system.
 void addEllipsoid(double xRad, double yRad, double zRad)
          Adds a solid ellipsoid with the given radii centered on the origin of the current coordinate system.
 void addEllipsoid(double xRad, double yRad, double zRad, javax.media.j3d.Appearance ellipsoidApp)
          Adds a solid ellipsoid with the given radii and appearance centered on the origin of the current coordinate system.
 void addGenTruncatedCone(double height, double bx, double by, double tx, double ty)
          Adds a truncated cone with the given height, base width x, base width y, top width x, and top width y centered on the origin of the current coordinate system.
 void addGenTruncatedCone(double height, double bx, double by, double tx, double ty, javax.media.j3d.Appearance coneApp)
          Adds a truncated cone with the given height, base width x, base width y, top width x, top width y, and appearance centered on the origin of the current coordinate system.
 void addGroup(javax.media.j3d.Group group)
          Adds the specified group to the origin of the current coordinate system.
 void addHemiEllipsoid(double xRad, double yRad, double zRad)
          Adds a hemi ellipsoid with the given x, y and z radii centered on the current coordinate system.
 void addHemiEllipsoid(double xRad, double yRad, double zRad, javax.media.j3d.Appearance hEApp)
          Adds a hemi ellipsoid with the given appearance and x, y and z radii centered on the current coordinate system.
 void addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints, javax.media.j3d.Appearance appearance)
          Creates a polygon centered at the current coordinate system with the given vertices.
 void addPolygon(javax.vecmath.Point3d[] polygonPoint)
          Creates a polygon centered at the current coordinate system with the given vertices.
 void addPolygon(javax.vecmath.Point3d[] polygonPoints, javax.media.j3d.Appearance appearance)
          Creates a polygon centered at the current coordinate system with the given vertices.
 void addPolygon(javax.vecmath.Point3f[] polygonPoint)
          Creates a polygon centered at the current coordinate system with the given vertices.
 void addPolygon(javax.vecmath.Point3f[] polygonPoints, javax.media.j3d.Appearance appearance)
          Creates a polygon centered at the current coordinate system with the given vertices.
 void addPyramidCube(double lx, double ly, double lz, double lh)
          Creates a pyramid cube centered on the origin of the current coordinate system.
 void addPyramidCube(double lx, double ly, double lz, double lh, javax.media.j3d.Appearance cubeApp)
          Creates a pyramid cube with the specified appearance centered on the origin of the current coordinate system.
 void addShape(javax.media.j3d.Geometry geometry, javax.media.j3d.Appearance appearance)
          Adds the given geometry with the specified appearance to the origin of the current coordinate system.
 void addShape(javax.media.j3d.Shape3D shape)
          Adds the specified shape to the origin of the current coordinate system.
 void addSphere(double radius)
          Adds a solid sphere with the given radius centered on the origin of the current coordinate system.
 void addSphere(double radius, javax.media.j3d.Appearance sphereApp)
          Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system.
 void addVRMLFile(java.lang.String fileName)
          Adds the specified VRML file to the center of the current coordinate system using the default appearance.
 void addVRMLFile(java.lang.String fileName, javax.media.j3d.Appearance app)
          Adds the specified VRML file to the center of the current coordinate system using the provided appearance.
 void addVRMLFile(java.net.URL fileURL)
          Adds the specified VRML file to the center of the current coordinate system using the default appearance.
 void addVRMLFile(java.net.URL fileURL, javax.media.j3d.Appearance app)
          Adds the specified VRML file to the center of the current coordinate system using the provided appearance.
 void addWedge(double lx, double ly, double lz)
          Adds a solid wedge with the given dimensions centered on the origin of the current coordinate system.
 void addWedge(double lx, double ly, double lz, javax.media.j3d.Appearance wedgeApp)
          Adds a solid wedge with the given dimensions and appearance centered on the origin of the current coordinate system.
 void combine(LinkGraphics linkGraphics)
          Merge this with the specified LinkGraphics.
 void createInertiaEllipsoid(Link link, javax.media.j3d.Appearance appearance)
           
 javax.vecmath.Color3f getColor(javax.media.j3d.Appearance app)
          gets a color from an appearance
 LinkGraphicsDefinition getLinkGraphicsDefinition()
           
 javax.media.j3d.SharedGroup getSharedGroup()
          Retrieves the shared group containing all of the graphical elements for this link.
 void identity()
          Resets the coordinate system to the joint origin.
 void rotate(double rotAng, int rotAxis)
          Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians.
 void rotate(double rotAng, javax.vecmath.Vector3d rotAxis)
          Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians.
 void rotate(javax.vecmath.Matrix3d rot)
          Rotates the coordinate system as described by the given rotation matrix.
 void scale(double scaleFactor)
          Scales the coordinate system by the specified scale factor.
 void scale(javax.vecmath.Vector3d scaleFactors)
          Scales the coordinate system by the specified scale factor.
 void translate(double tx, double ty, double tz)
          Translates from the current position by the specified distances.
 void translate(javax.vecmath.Vector3d translation)
          Translates from the current position by the specified distances.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkGraphics

public LinkGraphics(LinkGraphicsDefinition linkGraphicsDefinition)

LinkGraphics

public LinkGraphics()
Default no-arg constructor. This creates a new empty LinkGraphics component.

Method Detail

getLinkGraphicsDefinition

public LinkGraphicsDefinition getLinkGraphicsDefinition()

getColor

public javax.vecmath.Color3f getColor(javax.media.j3d.Appearance app)
gets a color from an appearance


combine

public void combine(LinkGraphics linkGraphics)
Merge this with the specified LinkGraphics.

Parameters:
linkGraphics - LinkGraphics to combine with.

translate

public void translate(double tx,
                      double ty,
                      double tz)
Translates from the current position by the specified distances. Graphic components added after translation will appear in the new location. The coordinate system for these translations is based on those that preceded it. Each new has its coordinates reset to the parent joint's origin. Identity resets back to the joint origin.

Parameters:
tx - distance translated in the x direction
ty - distance translated in the y direction
tz - distance translated in the z direction

translate

public void translate(javax.vecmath.Vector3d translation)
Translates from the current position by the specified distances. Graphic components added after translation will appear in the new location. The coordinate system for these translations is based on those that preceded it. Each new has its coordinates reset to the parent joint's origin. Identity resets back to the joint origin.

Parameters:
translation - Vector3d representing the translation.

rotate

public void rotate(double rotAng,
                   int rotAxis)
Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians. This does not rotate existing graphics, instead it rotates a "cursor" when another object is added it will be centered on the origin of the current system as described by the translations and rotations applied since its creation at the joint origin.

Parameters:
rotAng - the angle to rotate around the specified axis in radians.
rotAxis - Axis around which to rotate. Either Link.X, Link.Y or Link.Z

rotate

public void rotate(double rotAng,
                   javax.vecmath.Vector3d rotAxis)
Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians. This does not rotate existing graphics, instead it rotates a "cursor" When another object is added it will be centered on the origin of the current system as described by the translations and rotations applied since its creation at the joint origin.

Parameters:
rotAng - the angle to rotate around the specified axis in radians.
rotAxis - Vector3d describing the axis of rotation.

rotate

public void rotate(javax.vecmath.Matrix3d rot)
Rotates the coordinate system as described by the given rotation matrix. This does not rotate existing graphics, instead it rotates a "cursor". When another object is added it will be centered on the origin of the current system as described by the translations and rotations applied since its creation at the joint origin.

Parameters:
rot - Matrix3d describing the rotation to be applied.

scale

public void scale(double scaleFactor)
Scales the coordinate system by the specified scale factor. This does not scale existing graphics, instead it scales the "current" coordinate system. When another object is added it will be uniformly scaled by the specified factor.

Parameters:
scaleFactor - Factor by which the coordinate system is scaled. For example, 0.5 would reduce future objects size by 50% whereas 2 would double it.

scale

public void scale(javax.vecmath.Vector3d scaleFactors)
Scales the coordinate system by the specified scale factor. This does not scale existing graphics, instead it scales the "current" coordinate system. When another object is added it will be uniformly scaled by the specified factor. The components of the vector indicate scale factors in each dimension.

Parameters:
scaleFactors - Vector3d describing the scaling factors in each dimension.

identity

public void identity()
Resets the coordinate system to the joint origin. This clears all rotations, translations, and scale factors.


addShape

public void addShape(javax.media.j3d.Geometry geometry,
                     javax.media.j3d.Appearance appearance)
Adds the given geometry with the specified appearance to the origin of the current coordinate system. The YoAppearance and YoGeometry classes provide a number of basic appearances and shapes respectively. For more detailed information see the Java3d API.

Parameters:
geometry - Geometry of the new shape.
appearance - Appearance of the new shape.

addShape

public void addShape(javax.media.j3d.Shape3D shape)
Adds the specified shape to the origin of the current coordinate system. For more information see the Java3d API.

Parameters:
shape - Shape3D to be added.

addBranchGroup

public void addBranchGroup(javax.media.j3d.BranchGroup branchGroup)
Adds the specified BranchGroup to the origin of the current coordinate system. This group may contain a number of sub groups and graphics objects. For more information see the Java3d API.

Parameters:
branchGroup - BranchGroup to be added.

addGroup

public void addGroup(javax.media.j3d.Group group)
Adds the specified group to the origin of the current coordinate system. This group may contain a number of sub groups and graphics objects. For more information see the Java3d API.

Parameters:
group - Group to be added.

addVRMLFile

public void addVRMLFile(java.net.URL fileURL)
Adds the specified VRML file to the center of the current coordinate system using the default appearance. VRML, or Virtual Reality Modeling Language, is a standard file format describing 3d objects. For more information google VRML and read about it.

Parameters:
fileURL - URL describing the location of the VMRL file.

addVRMLFile

public void addVRMLFile(java.net.URL fileURL,
                        javax.media.j3d.Appearance app)
Adds the specified VRML file to the center of the current coordinate system using the provided appearance. VRML or Virtual Reality Modeling Language is a standard file format describing 3d objects. For more information google VRML and read about it.

Parameters:
fileURL - URL describing the location of the VRML file.
app - Appearance to use in the creation of this shape.

addVRMLFile

public void addVRMLFile(java.lang.String fileName,
                        javax.media.j3d.Appearance app)
Adds the specified VRML file to the center of the current coordinate system using the provided appearance. VRML or Virtual Reality Modeling Language is a standard file format describing 3d objects. For more information google VRML and read about it.

Parameters:
fileName - Path to the desired file.
app - Appearance to use with the VRML file.

addVRMLFile

public void addVRMLFile(java.lang.String fileName)
Adds the specified VRML file to the center of the current coordinate system using the default appearance. VRML, or Virtual Reality Modeling Language, is a standard file format describing 3d objects. For more information google VRML and read about it.

Parameters:
fileName - String

add3DSFile

public void add3DSFile(java.net.URL fileURL)
Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance. 3DS Max is a 3D modeling program that allows the creation of detailed models and animations. This function only imports the model allowing the use of more complicated and detailed system representations in simulations.

Parameters:
fileURL - URL pointing to the desired 3ds file.

add3DSFile

public void add3DSFile(java.net.URL fileURL,
                       javax.media.j3d.Appearance app)
Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance. 3DS Max is a 3D modeling program that allows the creation of detailed models and animations. This function only imports the model allowing the use of more complicated and detailed system representations in simulations.

Parameters:
fileURL - URL pointing to the desired 3ds file.
app - Appearance to use with the 3ds model once imported.

add3DSFile

public void add3DSFile(java.lang.String fileName)
Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance. 3DS Max is a 3D modeling program that allows the creation of detailed models and animations. This function only imports the model allowing the use of more complicated and detailed system representations in simulations.

Parameters:
fileName - File path of the desired 3ds file.

add3DSFile

public void add3DSFile(java.lang.String fileName,
                       javax.media.j3d.Appearance app)
Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance. 3DS Max is a 3D modeling program that allows the creation of detailed models and animations. This function only imports the model allowing the use of more complicated and detailed system representations in simulations.

Parameters:
fileName - File path to the desired 3ds file.
app - Appearance to use with the model once imported.

addCoordinateSystem

public void addCoordinateSystem(double length)

addCoordinateSystem

public void addCoordinateSystem(double length,
                                javax.media.j3d.Appearance arrowAppearance)

addCoordinateSystem

public void addCoordinateSystem(double length,
                                javax.media.j3d.Appearance xAxisAppearance,
                                javax.media.j3d.Appearance yAxisAppearance,
                                javax.media.j3d.Appearance zAxisAppearance,
                                javax.media.j3d.Appearance arrowAppearance)
Creates a graphical representation of the x, y, and z axis of the current coordinate system centered at its origin. In the image below red, white and blue represent the x, y and z axies respectively.

Parameters:
length - the length in meters of each axis arrow.

addCube

public void addCube(double lx,
                    double ly,
                    double lz)
Adds a solid black cube with the specified dimensions centered around the origin of the current coordinate system. All lengths are in meters. The image below demonstrates a 0.25 x 0.25 x 0.25 cube generated by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCube(0.25, 0.25, 0.25);

As is show by the graphical representation the cube is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
lx - length of the cube in the x direction.
ly - length of the cube in the y direction.
lz - length of the cube in the z direction.

addCube

public void addCube(double lx,
                    double ly,
                    double lz,
                    javax.media.j3d.Appearance cubeApp)
Adds a solid cube with the given dimensions and appearance centered on the origin of the current coordinate system. All lengths are in meters. The image below demonstrates a yellow 0.1 x 0.35 x 0.2 cube generated by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCube(0.1, 0.35, 0.2, YoAppearance.Yellow());

As is show by the graphical representation the cube is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
lx - length of the cube in the x direction.
ly - length of the cube in the y direction.
lz - length of the cube in the z direction.
cubeApp - Appearance of the cube. See YoAppearance for implementations.

addWedge

public void addWedge(double lx,
                     double ly,
                     double lz)
Adds a solid wedge with the given dimensions centered on the origin of the current coordinate system. The peak of the wedge is directly above the far edge of the cube in the x direction. The image below demonstrates a 0.25 x 0.25 x 0.25 wedge generated by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addWedge(0.25, 0.25, 0.25);

As is show by the graphical representation the wedge is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
lx - length of the wedge in the x direction.
ly - length of the wedge in the y direction.
lz - length of the wedge in the z direction.

addWedge

public void addWedge(double lx,
                     double ly,
                     double lz,
                     javax.media.j3d.Appearance wedgeApp)
Adds a solid wedge with the given dimensions and appearance centered on the origin of the current coordinate system. The peak of the wedge is directly above the far edge of the cube in the x direction. The image below demonstrates a green 0.35 x 0.3 x 0.1 wedge generated by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addWedge(0.35, 0.3, 0.1, YoAppearance.GREEN());

As is show by the graphical representation the wedge is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
lx - length of the wedge in the x direction.
ly - length of the wedge in the y direction.
lz - length of the wedge in the z direction.
wedgeApp - Appearance of the wedge. See YoAppearance for implementations.

addSphere

public void addSphere(double radius)
Adds a solid sphere with the given radius centered on the origin of the current coordinate system. The image below demonstrates a sphere with a 0.25 meter radius generated by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addSphere(0.25);

As is show by the graphical representation the sphere is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
radius - radius of the new sphere in meters.

addSphere

public void addSphere(double radius,
                      javax.media.j3d.Appearance sphereApp)
Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system. The image below demonstrates a blue sphere with a 0.15 meter radius generated by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addSphere(0.15, YoAppearance.Blue());

As is show by the graphical representation the sphere is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
radius - radius of the new sphere in meters.
sphereApp - Appearance to be used with the new sphere. See YoAppearance for implementations.

addEllipsoid

public void addEllipsoid(double xRad,
                         double yRad,
                         double zRad)
Adds a solid ellipsoid with the given radii centered on the origin of the current coordinate system. The image below demonstrates an ellipsoid with radii of 0.3, 0.2 and 0.1 in the x, y and z directions respectively:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addEllipsoid(0.3, 0.2, 0.1);

As is show by the graphical representation the ellipsoid is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
xRad - x direction radius in meters
yRad - y direction radius in meters
zRad - z direction radius in meters

addEllipsoid

public void addEllipsoid(double xRad,
                         double yRad,
                         double zRad,
                         javax.media.j3d.Appearance ellipsoidApp)
Adds a solid ellipsoid with the given radii and appearance centered on the origin of the current coordinate system. The image below demonstrates a red ellipsoid with radii of 0.2, 0.2 and 0.1 in the x, y and z directions respectively:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addEllipsoid(0.2, 0.2, 0.1, YoAppearance.Red());

As is show by the graphical representation the ellipsoid is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
xRad - x direction radius in meters
yRad - y direction radius in meters
zRad - z direction radius in meters
ellipsoidApp - Appearance to be used with the new ellipsoid. See YoAppearance for implementations.

addCylinder

public void addCylinder(double height,
                        double radius)
Adds a soild cylinder with the given radius and height centered on the origin of the current coordinate system. The image below demonstrates a cylinder with radius of 0.2 and a height of 0.4 as described by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCylinder(0.4, 0.2);

As is show by the graphical representation the cylinder is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
height - cylinder height in meters.
radius - cylinder radius in meters.

addCylinder

public void addCylinder(double height,
                        double radius,
                        javax.media.j3d.Appearance cylApp)
Adds a soild cylinder with the given radius, height and appearance centered on the origin of the current coordinate system. The image below demonstrates a maroon cylinder with radius of 0.3 and a height of 0.1 as described by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCylinder(0.1, 0.3, YoAppearance.Maroon());

As is show by the graphical representation the cylinder is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
height - cylinder height in meters.
radius - cylinder radius in meters.
cylApp - Appearance to be used with the new cylinder. See YoAppearance for implementations.

addCone

public void addCone(double height,
                    double radius)
Adds a cone with the given height and radius centered on the origin of the current coordinate system. The image below demonstrates a cone with radius of 0.15 and a height of 0.35 as described by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCone(0.35, 0.15);

As is show by the graphical representation the cone is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
height - cone height in meters.
radius - cone radius in meters.

addCone

public void addCone(double height,
                    double radius,
                    javax.media.j3d.Appearance coneApp)
Adds a cone with the given height, radius and appearance centered on the origin of the current coordinate system. The image below demonstrates a dark green cone with radius of 0.4 and a height of 0.2 as described by the following code:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addCone(0.2, 0.4, YoAppearance.DarkGreen());

As is show by the graphical representation the cone is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
height - cone height in meters.
radius - cone radius in meters.
coneApp - Appearance to be used with the new cone. See YoAppearance for implementations.

addGenTruncatedCone

public void addGenTruncatedCone(double height,
                                double bx,
                                double by,
                                double tx,
                                double ty)
Adds a truncated cone with the given height, base width x, base width y, top width x, and top width y centered on the origin of the current coordinate system. The image below demonstrates a truncated cone with a height of 0.3, a x base width of 0.25, a y base width of 0.2, a x top width of 0.15, and a y top width of 0.1:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addGenTruncatedCone(0.3, 0.25, 0.2, 0.15, 0.1);

As is show by the graphical representation the truncated cone is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
height - in meters
bx - x direction width of the base in meters
by - y direction width of the base in meters
tx - x direction width of the top in meters
ty - y direction width of the top in meters

addGenTruncatedCone

public void addGenTruncatedCone(double height,
                                double bx,
                                double by,
                                double tx,
                                double ty,
                                javax.media.j3d.Appearance coneApp)
Adds a truncated cone with the given height, base width x, base width y, top width x, top width y, and appearance centered on the origin of the current coordinate system. The image below demonstrates a navy blue truncated cone with a height of 0.25, a x base width of 0.15, a y base width of 0.15, a x top width of 0.05, and a y top width of 0.1:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addGenTruncatedCone(0.25, 0.15, 0.15, 0.05, 0.1, YoAppearance.Navy());

As is show by the graphical representation the truncated cone is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
height - in meters
bx - x direction width of the base in meters
by - y direction width of the base in meters
tx - x direction width of the top in meters
ty - y direction width of the top in meters
coneApp - Appearance to be used with the new truncated cone. See YoAppearance for implementations.

addHemiEllipsoid

public void addHemiEllipsoid(double xRad,
                             double yRad,
                             double zRad)
Adds a hemi ellipsoid with the given x, y and z radii centered on the current coordinate system. Hemi ellipsoids are essentially cut in half, in this case the missing half is below the xy plane. The image below demonstrates a hemi ellipsoid with x, y and z radii of 0.25, 0.15 and 0.35 respectively:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addHemiEllipsoid(0.25, 0.15, 0.35);

As is show by the graphical representation the hemi ellipsoid is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
xRad - radius of the ellipsoid in the x direction.
yRad - radius of the ellipsoid in the y direction.
zRad - radius of the ellipsoid in the z direction.

addHemiEllipsoid

public void addHemiEllipsoid(double xRad,
                             double yRad,
                             double zRad,
                             javax.media.j3d.Appearance hEApp)
Adds a hemi ellipsoid with the given appearance and x, y and z radii centered on the current coordinate system. Hemi ellipsoids are essentially cut in half, in this case the missing half is below the xy plane. The image below demonstrates a dark red hemi ellipsoid with x, y and z radii of 0.15, 0.2 and 0.4 respectively:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addHemiEllipsoid(0.15, 0.2, 0.4, YoAppearance.DarkRed());

As is show by the graphical representation the hemi ellipsoid is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
xRad - radius of the ellipsoid in the x direction.
yRad - radius of the ellipsoid in the y direction.
zRad - radius of the ellipsoid in the z direction.
hEApp - Appearance to be used with the new hemi ellipsoid. See YoAppearance for implementations.

addArcTorus

public void addArcTorus(double startAngle,
                        double endAngle,
                        double majorRadius,
                        double minorRadius)
Creates an ArcTorus centered on the current coordinate system. An ArcTorus is a toroid shape beginning at the start angle and wrapping around to the end angle. Ensure that the angles don't overlap as the shape will appear inverted; the start angle must be smaller than the end angle. All angles are measured in radians. The shape is also defined by its major and minor radii. The image below demonstrates a arctorus beginning at 3/2 pi and ending at 5/2 pi with major and minor radii of 0.25 and 0.15 respectively:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addArcTorus(3*Math.PI/2, 5*Math.PI/2, 0.25, 0.15);

As is show by the graphical representation the arctorus is centered on the coordinate system. Note that the ends of the torus have no texture or surface, they are transparent. Again, x, y and z are red, white and blue.

Parameters:
startAngle - Angle in radians at which the torus begins.
endAngle - Angle in radians at which the torus ends
majorRadius - Distance from the origin to the center of the torus
minorRadius - Distance from the center of the torus to the walls on either side.

addArcTorus

public void addArcTorus(double startAngle,
                        double endAngle,
                        double majorRadius,
                        double minorRadius,
                        javax.media.j3d.Appearance arcTorusApp)
Creates an ArcTorus centered on the current coordinate system with the specified appearance. An ArcTorus is a toroid shape beginning at the start angle and wrapping around to the end angle. Ensure that the angles don't overlap as the shape will appear inverted; the start angle must be smaller than the end angle. All angles are measured in radians. The shape is also defined by its major and minor radii. The minor radius is from the origin to the inner wall of the torus while the major is from the origin to the outer wall. The image below demonstrates an aqua arctorus beginning at 0 and ending at 3/2 pi with major and minor radii of 0.30 and 0.05 respectively:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addArcTorus(0, 3*Math.PI/2, 0.30, 0.05);

As is show by the graphical representation the arctorus is centered on the coordinate system. Note that the ends of the torus have no texture or surface, they are transparent. Again, x, y and z are red, white and blue.

Parameters:
startAngle - Angle in radians at which the torus begins.
endAngle - Angle in radians at which the torus ends.
majorRadius - Distance from the origin to the center of the torus.
minorRadius - Distance from the center of the torus to the walls on either side.
arcTorusApp - Appearance to be used with the new arctorus. See YoAppearance for implementations.

addPyramidCube

public void addPyramidCube(double lx,
                           double ly,
                           double lz,
                           double lh)
Creates a pyramid cube centered on the origin of the current coordinate system. A pyramid cube is nothing more than a standard cube of the given length, width and height with a square base pyramid of the specified height on the top and bottom. The image below demonstrates a pyramid cube beginning with dimensions of 0.2 by 0.2 by 0.2 and a pyramid height of 0.2:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addPyramidCube(0.2, 0.2, 0.2, 0.2);

As is show by the graphical representation the pyramid cube is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
lx - Length in meters of the cube. (x direction)
ly - Width in meters of the cube. (y direction)
lz - Height of the cube in meters. (z direction)
lh - Height of the pyramids in meters.

addPyramidCube

public void addPyramidCube(double lx,
                           double ly,
                           double lz,
                           double lh,
                           javax.media.j3d.Appearance cubeApp)
Creates a pyramid cube with the specified appearance centered on the origin of the current coordinate system. A pyramid cube is nothing more than a standard cube of the given length, width and height with a square base pyramid of the specified height on the top and bottom. The image below demonstrates a alluminum pyramid cube beginning with dimensions of 0.4 by 0.2 by 0.1 and a pyramid height of 0.3:

linkGraphics.addCoordinateSystem(0.5);
linkGraphics.addPyramidCube(0.2, 0.2, 0.2, 0.2);

As is show by the graphical representation the pyramid cube is centered on the coordinate system. Again, x, y and z are red, white and blue.

Parameters:
lx - Length in meters of the cube. (x direction)
ly - Width in meters of the cube. (y direction)
lz - Height of the cube in meters. (z direction)
lh - Height of the pyramids in meters.
cubeApp - Appearance to be used with the new pyramid cube. See YoAppearance for implementations.

addPolygon

public void addPolygon(javax.vecmath.Point3f[] polygonPoint)
Creates a polygon centered at the current coordinate system with the given vertices. The points this shape is composed of must be coplanar and the order matters. Randomly inserting points will produce unpredictable results, clockwise direction determines the side that is drawn.

Parameters:
polygonPoint - Point3f array containing the desired points.

addPolygon

public void addPolygon(javax.vecmath.Point3f[] polygonPoints,
                       javax.media.j3d.Appearance appearance)
Creates a polygon centered at the current coordinate system with the given vertices. The points this shape is composed of must be coplanar and the order matters. Randomly inserting points will produce unpredictable results, clockwise direction determines the side that is drawn.

Parameters:
polygonPoints - Point3f array containing the desired points.
appearance - Appearance to be used with the new polygon. See YoAppearance for implementations.

addPolygon

public void addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints,
                       javax.media.j3d.Appearance appearance)
Creates a polygon centered at the current coordinate system with the given vertices. The points this shape is composed of must be coplanar and the order matters. Randomly inserting points will produce unpredictable results, clockwise direction determines the side that is drawn.

Parameters:
polygonPoints - ArrayList containing the points.
appearance - Appearance to be used with the new polygon. See YoAppearance for implementations.

addPolygon

public void addPolygon(javax.vecmath.Point3d[] polygonPoint)
Creates a polygon centered at the current coordinate system with the given vertices. The points this shape is composed of must be coplanar and in a logical order. Randomly inserting points will produce unpredictable results, clockwise direction determines the side that is drawn.

Parameters:
polygonPoint - Array containing Point3d's to be used when generating the shape.

addPolygon

public void addPolygon(javax.vecmath.Point3d[] polygonPoints,
                       javax.media.j3d.Appearance appearance)
Creates a polygon centered at the current coordinate system with the given vertices. The points this shape is composed of must be coplanar and the order matters. Randomly inserting points will produce unpredictable results, clockwise direction determines the side that is drawn.

Parameters:
polygonPoints - Array containing the points
appearance - Appearance to be used with the new polygon. See YoAppearance for implementations.

createInertiaEllipsoid

public void createInertiaEllipsoid(Link link,
                                   javax.media.j3d.Appearance appearance)

getSharedGroup

public javax.media.j3d.SharedGroup getSharedGroup()
Retrieves the shared group containing all of the graphical elements for this link. This can be used to make a copy or add the link graphically to another component.

Returns:
SharedGroup for this link.