public class Vertex extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
b |
double |
g |
double |
r |
double |
x |
double |
y |
double |
z |
Constructor and Description |
---|
Vertex()
Construct a default vertex.
|
Vertex(double x,
double y,
double z)
Construct a new vertex using the given x, y, and z coordinates.
|
Vertex(double x,
double y,
double z,
java.awt.Color c)
Construct a new vertex with the given coordinates
and the given color.
|
Vertex(Vertex v)
Construct a new vertex that is a copy of another vertex.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Get the color of this vertex.
|
void |
set(double x,
double y,
double z)
Set the coordinates of this vertex.
|
void |
setColor(java.awt.Color c)
Set the color of this vertex using a Color object.
|
void |
setColor(double r,
double g,
double b)
Set the color of this vertex using doubles between 0 and 1.
|
void |
setColor(int r,
int g,
int b)
Set the color of this vertex using ints between 0 and 255.
|
void |
setColor(Vertex v)
Set the color of this vertex using the colors from another vertex.
|
void |
setColorRandom()
Set the color of this vertex to a random color.
|
java.lang.String |
toString()
For debugging.
|
public double b
public double g
public double r
public double x
public double y
public double z
public Vertex()
public Vertex(double x, double y, double z)
x
- x-coordinate of the new Vertexy
- y-coordinate of the new Vertexz
- z-coordinate of the new Vertexpublic Vertex(double x, double y, double z, java.awt.Color c)
x
- x-coordinate of the new Vertexy
- y-coordinate of the new Vertexz
- z-coordinate of the new Vertexc
- Color of the new Vertexpublic java.awt.Color getColor()
public void set(double x, double y, double z)
x
- new x-coordinate for this Vertexy
- new y-coordinate for this Vertexz
- new z-coordinate for this Vertexpublic void setColor(java.awt.Color c)
c
- Color for this Vertex objectpublic void setColor(double r, double g, double b)
r
- red color value for this Vertex as a double between 0 and 1g
- green color value for this Vertex as a double between 0 and 1b
- blue color value for this Vertex as a double between 0 and 1public void setColor(int r, int g, int b)
r
- red color value for this Vertex as an integer between 0 and 255g
- green color value for this Vertex as an integer between 0 and 255b
- blue color value for this Vertex as an integer between 0 and 255public void setColor(Vertex v)
v
- Vertex object to get color values frompublic void setColorRandom()
public java.lang.String toString()
toString
in class java.lang.Object