public class Vertex3D
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Vector3D
representing the "vertex normal"
Color
representing the vertex color
Vector3D
representing the "vertex tangent"
Vector3D
representing the "vertex binormal"
Vector3D
representing the vertex "tangent space light vector"
Constructor and Description |
---|
Vertex3D()
Creates a new Vertex3D with default values.
|
Vertex3D(double X,
double Y,
double Z)
Creates a new Vertex3D with the specified X,Y,Z location coordinates and
default values for other attributes as specified by the no-argument
constructor.
|
Vertex3D(double X,
double Y,
double Z,
double W)
Creates a new Vertex3D with the specified X,Y,Z, and W location
coordinates and default values for other attributes as specified by
the no-argument constructor.
|
Vertex3D(Point3D p)
Creates a new Vertex3D with the X,Y,Z, and W values specified by the
given Point3D.
|
Modifier and Type | Method and Description |
---|---|
Point3D |
add(Vertex3D v2)
Returns a new Point3D whose X,Y,Z values are the sum of this vertex's
location values and the specified vertex's location values.
|
java.lang.Object |
clone()
Returns a new Object which is a deep clone of this Vertex3D.
|
Vector3D |
cross(Vector3D aVector)
Returns a Vector3D which represents the vector formed by taking the cross
product of the vector implied by this vertex's X,Y,Z location with the
specified vector.
|
Vector3D |
cross(Vertex3D aVertex)
Returns a Vector3D which represents the vector formed by taking the cross
product of the vector implied by this vertex's X,Y,Z location with the
vector implied by the specified vertex's X,Y,Z location.
|
double |
distanceTo(Vertex3D v2)
Returns a real number that is the distance between this vertex's location
and the specified vertex's location.
|
Point3D |
div(double theDivisor)
Returns a new Point3D which is the result of dividing this vertex's X,Y,Z
location values by the given divisor.
|
double |
dot(Vertex3D v)
Returns the value of the "dot product" of the vector implied by this
vertex's X,Y,Z with the vector implied by the specified vertex's X,Y,Z.
|
Vector3D |
getBinormal()
Returns the Vertex3D "binormal" vector.
|
java.awt.Color |
getColor()
Returns a new Color object whose RGB values are the same as the RGB color
values of this Vertex3D object.
|
float[] |
getFloatTextureCoords()
Returns a float array containing the S,T,P, and Q components of this Vertex3D object's
texture coordinate.
|
Point3D |
getLocation()
Returns a new Point3D object whose location is the same as the location
of this Vertex3D.
|
Vector3D |
getNormal()
Returns a new Vector3D object whose magnitude and direction are the same
as the vertex normal of this vertex.
|
double |
getNormalX()
Returns the current value of the X component of the vertex normal.
|
double |
getNormalY()
Returns the current value of the Y component of the vertex normal.
|
double |
getNormalZ()
Returns the current value of the Z component of the vertex normal.
|
double |
getP()
Returns the P value of this Vertex3D object's texture coordinate.
|
double |
getQ()
Returns the Q value (that is, the homogeneous component) of this Vertex3D
object's texture coordinate.
|
double |
getS()
Returns the S value of this Vertex3D object's texture coordinate.
|
double[] |
getSTPQ()
Returns a double array containing the S,T,P, and Q components of this Vertex3D object's
texture coordinate.
|
double |
getT()
Returns the V value of this Vertex3D object's texture coordinate.
|
Vector3D |
getTangent()
Returns the Vertex3D tangent vector.
|
Vector3D |
getTangentSpaceLightVector()
Returns the Vertex3D tangent space light vector.
|
double |
getW()
Returns the W value (the homogeneous component) of this Vertex3D object's
location.
|
double |
getX()
Returns the X value of this Vertex3D object's location.
|
double |
getY()
Returns the Y value of this Vertex3D object's location.
|
double |
getZ()
Returns the Z value of this Vertex3D object's location.
|
Point3D |
mid(Vertex3D v2)
Returns a new Point3D which is the midpoint between this vertex's
location and the specified vertex's location.
|
Point3D |
minus(Vertex3D v2)
Returns a new Point3D whose X,Y,Z values are the difference between this
vertex's X,Y,Z location values and the specified vertex's X,Y,Z location
values.
|
Point3D |
mult(double theMultiplier)
Returns a new Point3D which is the result of multiplying this vertex's
X,Y,Z location values by the given multiplier.
|
Vertex3D |
mult(Matrix3D mat)
Returns a new Vertex3D object which is a clone of this vertex but with a
Point3D location generated by multiplying this vertex's location by the
specified Matrix3D.
|
void |
scale(double scaleFactor)
Scales each of the X, Y, and Z components of this vertex's location by
the given scaleFactor.
|
void |
set2DTextureCoordinates(double newS,
double newT)
Sets the S,T texture coordinate values of this Vertex3D object.
|
void |
setBinormal(float x,
float y,
float z)
Sets the binormal of this Vertex3D to the specified vector values.
|
void |
setBinormal(Vector3D newBinormal)
Sets the binormal (also sometimes called "bitangent")
of this Vertex3D to a new Vector3D object which is
a clone of the specified Vector3D object.
|
void |
setColor(java.awt.Color newColor)
Sets the color of this Vertex3D object to the RGB values of the specified
Color object.
|
void |
setColor(int r,
int g,
int b)
Sets the color of this Vertex3D object to the specified RGB Color values.
|
void |
setLocation(double newX,
double newY,
double newZ)
Sets the X,Y,Z components of the location of this Vertex3D object to the
specified values.
|
void |
setLocation(double newX,
double newY,
double newZ,
double newW)
Sets the location of this Vertex3D object to the specified values.
|
void |
setLocation(Point3D thePoint)
Sets the location of this Vertex3D object to be the same as the location
of the specified Point3D.
|
void |
setNormal(double x,
double y,
double z)
Sets the vertex normal of this Vertex3D to the specified vector values.
|
void |
setNormal(float x,
float y,
float z)
Sets the vertex normal of this Vertex3D to the specified vector values.
|
void |
setNormal(Vector3D newNormal)
Sets the vertex normal of this Vertex3D to a new Vector3D object which is
a clone of the specified Vector3D object.
|
void |
setNormalX(double newX)
Sets the value of the X component of the vertex normal to the specified
value.
|
void |
setNormalY(double newY)
Sets the value of the Y component of the vertex normal to the specified
value.
|
void |
setNormalZ(double newZ)
Sets the value of the Z component of the vertex normal to the specified
value.
|
void |
setP(double newP)
Sets the P value of this Vertex3D object's texture coordinate to the
specified value.
|
void |
setQ(double newQ)
Sets the Q value (that is, the homogeneous component) of this Vertex3D
object's texture coordinate to the specified value.
|
void |
setS(double newS)
Sets the S value of this Vertex3D object's texture coordinate to the
specified value.
|
void |
setST(double newS,
double newT)
Sets the S,T 2D texture coordinate values of this Vertex3D object.
|
void |
setSTP(double newS,
double newT,
double newP)
Sets the S,T,P 3D texture coordinate values of this Vertex3D object.
|
void |
setSTPQ(double newS,
double newT,
double newP,
double newQ)
Sets the S,T,P,Q 4D texture coordinate values of this Vertex3D object.
|
void |
setT(double newT)
Sets the T value of this Vertex3D object's texture coordinate to the
specified value.
|
void |
setTangent(float x,
float y,
float z)
Sets the tangent of this Vertex3D to the specified vector values.
|
void |
setTangent(Vector3D newTangent)
Sets the tangent of this Vertex3D to a new Vector3D object which is
a clone of the specified Vector3D object.
|
void |
setTangentSpaceLightVector(Vector3D newVector)
Sets the Vertex3D tangent space light vector to the specified vector.
|
void |
setW(double newW)
Sets the W value (the homogeneous component) of this Vertex3D object's
location to the specified value.
|
void |
setX(double newX)
Sets the X value of this Vertex3D object's location to the specified
value.
|
void |
setY(double newY)
Sets the Y value of this Vertex3D object's location to the specified
value.
|
void |
setZ(double newZ)
Sets the Z value of this Vertex3D object's location to the specified
value.
|
java.lang.String |
toString()
Returns a printable representation of this Vertex3D.
|
public Vertex3D()
public Vertex3D(double X, double Y, double Z)
public Vertex3D(double X, double Y, double Z, double W)
public Vertex3D(Point3D p)
public Point3D getLocation()
public java.awt.Color getColor()
public Vector3D getNormal()
public double getNormalX()
public double getNormalY()
public double getNormalZ()
public double getX()
public double getY()
public double getZ()
public double getW()
public double getS()
public double getT()
public double getP()
public double getQ()
public float[] getFloatTextureCoords()
public double[] getSTPQ()
public Vector3D getTangent()
public Vector3D getBinormal()
public Vector3D getTangentSpaceLightVector()
public void setLocation(Point3D thePoint)
public void setLocation(double newX, double newY, double newZ, double newW)
public void setLocation(double newX, double newY, double newZ)
public void setNormal(Vector3D newNormal)
public void setNormal(float x, float y, float z)
public void setNormal(double x, double y, double z)
public void setNormalX(double newX)
public void setNormalY(double newY)
public void setNormalZ(double newZ)
public void setBinormal(Vector3D newBinormal)
public void setBinormal(float x, float y, float z)
public void setTangent(Vector3D newTangent)
public void setTangent(float x, float y, float z)
public void setTangentSpaceLightVector(Vector3D newVector)
public void setColor(java.awt.Color newColor)
public void setColor(int r, int g, int b)
public void setX(double newX)
public void setY(double newY)
public void setZ(double newZ)
public void setW(double newW)
public void setS(double newS)
public void setT(double newT)
public void setP(double newP)
public void setQ(double newQ)
public void setST(double newS, double newT)
public void set2DTextureCoordinates(double newS, double newT)
public void setSTP(double newS, double newT, double newP)
public void setSTPQ(double newS, double newT, double newP, double newQ)
public java.lang.Object clone()
clone
in class java.lang.Object
public Point3D minus(Vertex3D v2)
public double distanceTo(Vertex3D v2)
public Point3D add(Vertex3D v2)
public Point3D mid(Vertex3D v2)
public Point3D mult(double theMultiplier)
public Point3D div(double theDivisor)
public Vertex3D mult(Matrix3D mat)
public void scale(double scaleFactor)
public double dot(Vertex3D v)
public Vector3D cross(Vertex3D aVertex)
public Vector3D cross(Vector3D aVector)
public java.lang.String toString()
toString
in class java.lang.Object