us.ihmc.graphics3DAdapter.graphics
Class Graphics3DObject

java.lang.Object
  extended by us.ihmc.graphics3DAdapter.graphics.Graphics3DObject

public class Graphics3DObject
extends java.lang.Object


Field Summary
static Axis X
           
static Axis Y
           
static Axis Z
           
 
Constructor Summary
Graphics3DObject()
          Default no-arg constructor.
Graphics3DObject(java.util.ArrayList<Graphics3DPrimitiveInstruction> graphics3DInstructions)
           
 
Method Summary
 Graphics3DAddMeshDataInstruction addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius)
          Creates an ArcTorus centered on the current coordinate system.
 Graphics3DAddMeshDataInstruction addArcTorus(double startAngle, double endAngle, double majorRadius, double minorRadius, AppearanceDefinition arcTorusApp)
          Creates an ArcTorus centered on the current coordinate system with the specified appearance.
 void addArrow(double length, AppearanceDefinition baseAppearance, AppearanceDefinition headAppearance)
           
 Graphics3DAddMeshDataInstruction addCone(double height, double radius)
          Adds a cone with the given height and radius centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addCone(double height, double radius, AppearanceDefinition 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, AppearanceDefinition arrowAppearance)
           
 void addCoordinateSystem(double length, AppearanceDefinition xAxisAppearance, AppearanceDefinition yAxisAppearance, AppearanceDefinition zAxisAppearance, AppearanceDefinition arrowAppearance)
          Creates a graphical representation of the x, y, and z axis of the current coordinate system centered at its origin.
 Graphics3DAddMeshDataInstruction 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.
 Graphics3DAddMeshDataInstruction addCube(double lx, double ly, double lz, AppearanceDefinition cubeApp)
          Adds a solid cube with the given dimensions and appearance centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addCylinder(double height, double radius)
          Adds a soild cylinder with the given radius and height centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addCylinder(double height, double radius, AppearanceDefinition cylApp)
          Adds a soild cylinder with the given radius, height and appearance centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addEllipsoid(double xRadius, double yRadius, double zRadius)
          Adds a solid ellipsoid with the given radii centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addEllipsoid(double xRadius, double yRadius, double zRadius, AppearanceDefinition ellipsoidApp)
          Adds a solid ellipsoid with the given radii and appearance centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints, double height)
           
 Graphics3DAddMeshDataInstruction addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints, double height, AppearanceDefinition appearance)
           
 Graphics3DAddExtusionInstruction addExtrusion(java.awt.image.BufferedImage bufferedImageToExtrude, double thickness, AppearanceDefinition appearance)
          Create an extrusion of a BufferedImage.
 Graphics3DAddMeshDataInstruction 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.
 Graphics3DAddMeshDataInstruction addGenTruncatedCone(double height, double bx, double by, double tx, double ty, AppearanceDefinition 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.
 Graphics3DInstruction addHeightMap(HeightMap heightMap, int xPointsPerSide, int yPointsPerSide, AppearanceDefinition appearance)
           
 Graphics3DAddMeshDataInstruction 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.
 Graphics3DAddMeshDataInstruction addHemiEllipsoid(double xRad, double yRad, double zRad, AppearanceDefinition hEApp)
          Adds a hemi ellipsoid with the given appearance and x, y and z radii centered on the current coordinate system.
 void addInstruction(Graphics3DPrimitiveInstruction instruction)
           
 Graphics3DAddMeshDataInstruction addMeshData(MeshDataHolder meshData, AppearanceDefinition meshAppearance)
           
 void addModelFile(java.lang.String fileName)
          Adds the specified model file to the center of the current coordinate system with a default appearance.
 Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName, AppearanceDefinition app)
           
 Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName, java.util.ArrayList<java.lang.String> resourceDirectories, AppearanceDefinition app)
           
 Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName, java.lang.String submesh, boolean centerSubmesh, java.util.ArrayList<java.lang.String> resourceDirectories, AppearanceDefinition app)
           
 void addModelFile(java.net.URL fileURL)
          Adds the specified 3DS Max file to the center of the current coordinate system with a default appearance.
 void addModelFile(java.net.URL fileURL, AppearanceDefinition yoAppearanceDefinition)
          Adds the specified 3DS Max file to the center of the current coordinate system with the given appearance.
 Graphics3DAddMeshDataInstruction addPolygon(AppearanceDefinition yoAppearance, javax.vecmath.Point3d... polygonPoints)
           
 Graphics3DAddMeshDataInstruction addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints)
           
 Graphics3DAddMeshDataInstruction addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints, AppearanceDefinition yoAppearance)
          Creates a polygon centered at the current coordinate system with the given vertices.
 Graphics3DAddMeshDataInstruction addPolygon(javax.vecmath.Point3d[] polygonPoint)
          Creates a polygon centered at the current coordinate system with the given vertices.
 Graphics3DAddMeshDataInstruction addPolygon(javax.vecmath.Point3d[] polygonPoints, AppearanceDefinition yoAppearance)
          Creates a polygon centered at the current coordinate system with the given vertices.
 Graphics3DAddMeshDataInstruction addPyramidCube(double lx, double ly, double lz, double lh)
          Creates a pyramid cube centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addPyramidCube(double lx, double ly, double lz, double lh, AppearanceDefinition cubeApp)
          Creates a pyramid cube with the specified appearance centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addSphere(double radius)
          Adds a solid sphere with the given radius centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addSphere(double radius, AppearanceDefinition sphereApp)
          Adds a solid sphere with the given radius and appearance centered on the origin of the current coordinate system.
 Graphics3DInstruction addTeaPot(AppearanceDefinition appearance)
           
 Graphics3DAddExtusionInstruction addText(java.lang.String text, double thickness, AppearanceDefinition yoAppearance)
           
 Graphics3DAddMeshDataInstruction addWedge(double lx, double ly, double lz)
          Adds a solid wedge with the given dimensions centered on the origin of the current coordinate system.
 Graphics3DAddMeshDataInstruction addWedge(double lx, double ly, double lz, AppearanceDefinition wedgeApp)
          Adds a solid wedge with the given dimensions and appearance centered on the origin of the current coordinate system.
 void combine(Graphics3DObject Graphics3DObject)
          Merge this with the specified Graphics3DObject.
 void createInertiaEllipsoid(javax.vecmath.Matrix3d momentOfInertia, javax.vecmath.Vector3d comOffset, double mass, AppearanceDefinition appearance)
           
 java.util.ArrayList<Graphics3DPrimitiveInstruction> getGraphics3DInstructions()
           
 void identity()
          Resets the coordinate system to the joint origin.
 boolean isChangeable()
           
 void notifySelectedListeners(Graphics3DNode graphics3dNode, ModifierKeyInterface modifierKeyHolder, javax.vecmath.Point3d location, javax.vecmath.Point3d cameraPosition, javax.vecmath.Quat4d cameraRotation)
           
 void registerSelectedListener(SelectedListener selectedListener)
           
 void rotate(javax.vecmath.AxisAngle4d rotationAxisAngle)
           
 void rotate(double rotationAngle, Axis rotationAxis)
          Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians.
 void rotate(double rotationAngle, javax.vecmath.Vector3d rotationAxis)
          Rotates the coordinate system counter clockwise around the specified axis by the given angle in radians.
 void rotate(javax.vecmath.Matrix3d rotationMatrix)
          Rotates the coordinate system as described by the given rotation matrix.
 Graphics3DScaleInstruction scale(double scaleFactor)
          Scales the coordinate system by the specified scale factor.
 Graphics3DScaleInstruction scale(javax.vecmath.Vector3d scaleFactors)
          Scales the coordinate system by the specified scale factor.
 void setChangeable(boolean changeable)
           
 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
 

Field Detail

X

public static final Axis X

Y

public static final Axis Y

Z

public static final Axis Z
Constructor Detail

Graphics3DObject

public Graphics3DObject(java.util.ArrayList<Graphics3DPrimitiveInstruction> graphics3DInstructions)

Graphics3DObject

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

Method Detail

getGraphics3DInstructions

public java.util.ArrayList<Graphics3DPrimitiveInstruction> getGraphics3DInstructions()

combine

public void combine(Graphics3DObject Graphics3DObject)
Merge this with the specified Graphics3DObject.

Parameters:
graphics3DObject - Graphics3DObject to combine with.

addInstruction

public void addInstruction(Graphics3DPrimitiveInstruction instruction)

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 rotationAngle,
                   Axis rotationAxis)
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:
rotationAngle - the angle to rotate around the specified axis in radians.
rotationAxis - Axis around which to rotate. Either Link.X, Link.Y or Link.Z

rotate

public void rotate(double rotationAngle,
                   javax.vecmath.Vector3d rotationAxis)
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:
roationAngle - the angle to rotate around the specified axis in radians.
rotationAxis - Vector3d describing the axis of rotation.

rotate

public void rotate(javax.vecmath.Matrix3d rotationMatrix)
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:
rotationMatrix - Matrix3d describing the rotation to be applied.

rotate

public void rotate(javax.vecmath.AxisAngle4d rotationAxisAngle)

scale

public Graphics3DScaleInstruction 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.
Returns:

scale

public Graphics3DScaleInstruction 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.
Returns:

identity

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


addModelFile

public void addModelFile(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.

addModelFile

public void addModelFile(java.net.URL fileURL,
                         AppearanceDefinition yoAppearanceDefinition)
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.
yoAppearanceDefinition - Appearance to use with the 3ds model once imported.

addModelFile

public void addModelFile(java.lang.String fileName)
Adds the specified model file to the center of the current coordinate system with a default appearance. Supported model files are .stl, .obj, .dae, .vrml and .3ds. Appearances of model files can only be changed at runtime if an appearance is given while loading the model

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

addModelFile

public Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName,
                                                      AppearanceDefinition app)
Parameters:
fileName -
app -
Returns:

addModelFile

public Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName,
                                                      java.lang.String submesh,
                                                      boolean centerSubmesh,
                                                      java.util.ArrayList<java.lang.String> resourceDirectories,
                                                      AppearanceDefinition app)

addModelFile

public Graphics3DAddModelFileInstruction addModelFile(java.lang.String fileName,
                                                      java.util.ArrayList<java.lang.String> resourceDirectories,
                                                      AppearanceDefinition app)

addCoordinateSystem

public void addCoordinateSystem(double length)

addCoordinateSystem

public void addCoordinateSystem(double length,
                                AppearanceDefinition arrowAppearance)

addCoordinateSystem

public void addCoordinateSystem(double length,
                                AppearanceDefinition xAxisAppearance,
                                AppearanceDefinition yAxisAppearance,
                                AppearanceDefinition zAxisAppearance,
                                AppearanceDefinition 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.

addArrow

public void addArrow(double length,
                     AppearanceDefinition baseAppearance,
                     AppearanceDefinition headAppearance)

addCube

public Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addCube(double lx,
                                                double ly,
                                                double lz,
                                                AppearanceDefinition 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.
Returns:

addWedge

public Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addWedge(double lx,
                                                 double ly,
                                                 double lz,
                                                 AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addSphere(double radius,
                                                  AppearanceDefinition 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.

addMeshData

public Graphics3DAddMeshDataInstruction addMeshData(MeshDataHolder meshData,
                                                    AppearanceDefinition meshAppearance)

addEllipsoid

public Graphics3DAddMeshDataInstruction addEllipsoid(double xRadius,
                                                     double yRadius,
                                                     double zRadius)
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 Graphics3DAddMeshDataInstruction addEllipsoid(double xRadius,
                                                     double yRadius,
                                                     double zRadius,
                                                     AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addCylinder(double height,
                                                    double radius,
                                                    AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addCone(double height,
                                                double radius,
                                                AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addGenTruncatedCone(double height,
                                                            double bx,
                                                            double by,
                                                            double tx,
                                                            double ty,
                                                            AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addHemiEllipsoid(double xRad,
                                                         double yRad,
                                                         double zRad,
                                                         AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addArcTorus(double startAngle,
                                                    double endAngle,
                                                    double majorRadius,
                                                    double minorRadius,
                                                    AppearanceDefinition 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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addPyramidCube(double lx,
                                                       double ly,
                                                       double lz,
                                                       double lh,
                                                       AppearanceDefinition 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 Graphics3DAddMeshDataInstruction addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints)

addPolygon

public Graphics3DAddMeshDataInstruction addPolygon(java.util.ArrayList<javax.vecmath.Point3d> polygonPoints,
                                                   AppearanceDefinition yoAppearance)
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 Graphics3DAddMeshDataInstruction 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 Graphics3DAddMeshDataInstruction addPolygon(javax.vecmath.Point3d[] polygonPoints,
                                                   AppearanceDefinition yoAppearance)
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.

addPolygon

public Graphics3DAddMeshDataInstruction addPolygon(AppearanceDefinition yoAppearance,
                                                   javax.vecmath.Point3d... polygonPoints)

addExtrudedPolygon

public Graphics3DAddMeshDataInstruction addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints,
                                                           double height)

addExtrudedPolygon

public Graphics3DAddMeshDataInstruction addExtrudedPolygon(java.util.List<javax.vecmath.Point2d> polygonPoints,
                                                           double height,
                                                           AppearanceDefinition appearance)

addExtrusion

public Graphics3DAddExtusionInstruction addExtrusion(java.awt.image.BufferedImage bufferedImageToExtrude,
                                                     double thickness,
                                                     AppearanceDefinition appearance)
Create an extrusion of a BufferedImage. Black pixels of the image are extruded. A pixel is considered black when (red+green+blue)/3 < 60

Parameters:
bufferedImageToExtrude - BufferedImage to extrude
thickness - Thinkness of extrusion
appearance - Appearance

addText

public Graphics3DAddExtusionInstruction addText(java.lang.String text,
                                                double thickness,
                                                AppearanceDefinition yoAppearance)

createInertiaEllipsoid

public void createInertiaEllipsoid(javax.vecmath.Matrix3d momentOfInertia,
                                   javax.vecmath.Vector3d comOffset,
                                   double mass,
                                   AppearanceDefinition appearance)

addTeaPot

public Graphics3DInstruction addTeaPot(AppearanceDefinition appearance)

addHeightMap

public Graphics3DInstruction addHeightMap(HeightMap heightMap,
                                          int xPointsPerSide,
                                          int yPointsPerSide,
                                          AppearanceDefinition appearance)

notifySelectedListeners

public void notifySelectedListeners(Graphics3DNode graphics3dNode,
                                    ModifierKeyInterface modifierKeyHolder,
                                    javax.vecmath.Point3d location,
                                    javax.vecmath.Point3d cameraPosition,
                                    javax.vecmath.Quat4d cameraRotation)

registerSelectedListener

public void registerSelectedListener(SelectedListener selectedListener)

isChangeable

public boolean isChangeable()

setChangeable

public void setChangeable(boolean changeable)