public class Model extends Object
Model
data structure represents a distinct geometric object
in a Scene
. A Model data structure is mainly a List
of
LineSegment
objects. Each LineSegment
object contains
two Vertex
objects with coordinates in the camera coordinate
system.
The line segments represent the geometric object as a "wire-frame", that is, the geometric object is drawn as a collection of "edges". This is a fairly simplistic way of doing 3D graphics and we will improve this in later renderers.
See
http://en.wikipedia.org/wiki/Wire-frame_model
or
https://www.google.com/search?q=graphics+wireframe&tbm=isch
Modifier and Type | Field and Description |
---|---|
boolean |
hidden |
List<LineSegment> |
lineSegmentList |
Constructor and Description |
---|
Model()
Construct an empty Model.
|
Modifier and Type | Method and Description |
---|---|
void |
addLineSegment(LineSegment... lsArray)
Add a
LineSegment (or LineSegments) to this Model's
List of line segments. |
void |
setColor(Color c)
Set each
LineSegment in this Model to the same color. |
void |
setColorRandom()
Set each
LineSegment in this Model to the same random color. |
void |
setRandomColors()
Set each
LineSegment in this Model to a different random color. |
String |
toString()
For debugging.
|
public boolean hidden
public List<LineSegment> lineSegmentList
public Model()
public void addLineSegment(LineSegment... lsArray)
LineSegment
(or LineSegments) to this Model's
List
of line segments.lsArray
- array of LineSegments to add to this Modelpublic void setColor(Color c)
LineSegment
in this Model to the same color.c
- Color for all of this model's LineSegmentspublic void setColorRandom()
LineSegment
in this Model to the same random color.public void setRandomColors()
LineSegment
in this Model to a different random color.