3D Elements Methods

All 3D elements implement the interface org.opensourcephysics.display3d.core.Element.Hence they support the following methods:

Position and Size
void setXYZ(double x, double y, double z)
Set the X, Y, and Z coordinates of the element.
void setXYZ(double[] pos)
Sets the coordinates of the element. If pos.length<=2 it sets only X and Y. If pos.length>2 it sets X, Y, and Z.
void setSizeXYZ(double sizeX, double sizeY, double sizeZ)
Set the size along the X, Y and Z axes.
void setSizeXYZ(double[] size)
Sets the size of the element. If size.length<=2 it sets only the size in X and Y. If size.length>3 it sets the size in X, Y, and Z.
Transformation and Reference Systems
void setTransformation(org.opensourcephysics.numerics.Transformation transformation)
Sets the internal transformation of the element, that is, the transformation that converts the standard XYZ axes to the body's internal reference axes.
double[] toSpaceFrame(double[] vector)
This method transforms a double[3] vector from the body's frame to the space's frame. vector contains the original coordinates in the body frame. The method returns the same array once transformed.
double[] toBodyFrame(double[] vector) throws UnsupportedOperationException
This method converts a double[3] vector from the space's frame to the body's frame. This only works properly if the internal transformation is not set (i.e. it is the identity) or if it is invertible. Otherwise, a call to this method will throw an UnsupportedOperationException exception. vector contains the original coordinates in the space. The method returns the same array with the body coordinates.