Package edu.cnu.mdi.mdi3D.item3D
Class Triangle3D
java.lang.Object
edu.cnu.mdi.mdi3D.item3D.Item3D
edu.cnu.mdi.mdi3D.item3D.Triangle3D
A single filled (and optionally framed) triangle, defined by three vertices
in world coordinates.
-
Field Summary
FieldsFields inherited from class edu.cnu.mdi.mdi3D.item3D.Item3D
_panel3D, FILLALPHA, FILLCOLOR, FONT, LINE_WIDTH, LINEALPHA, LINECOLOR, TEXT_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionTriangle3D(Panel3D panel3d, float[] coords, Color color, float lineWidth, boolean frame) Create a triangle from an array of coordinatesTriangle3D(Panel3D panel3d, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, Color color, float lineWidth, boolean frame) Create a triangle from nine explicit coordinates -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(com.jogamp.opengl.GLAutoDrawable drawable) The custom drawing methodfloat[]A representative point for transparent sorting, in world coordinates.Methods inherited from class edu.cnu.mdi.mdi3D.item3D.Item3D
addChild, defaultProperties, dispose, disposeItem, drawItem, get, getChildren, getColor, getFillAlpha, getFillColor, getFloat, getFont, getFont, getInt, getLineAlpha, getLineColor, getLineWidth, getPanel3D, getParent, getString, getTextColor, isVisible, put, removeChild, setAlphaOfColor, setFillAlpha, setFillColor, setFont, setLineAlpha, setLineColor, setLineWidth, setTextColor, setVisible
-
Field Details
-
_coords
protected float[] _coords -
_frame
protected boolean _frame
-
-
Constructor Details
-
Triangle3D
Create a triangle from an array of coordinates- Parameters:
panel3d- the owner panelcoords- the coordinates [x1, y1, ..., y3, z3]color- the triangle colorlineWidth- the line widthframe- frame the triangle
-
Triangle3D
public Triangle3D(Panel3D panel3d, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, Color color, float lineWidth, boolean frame) Create a triangle from nine explicit coordinates- Parameters:
panel3d- the owner panelx1-y1-z1-x2-y2-z2-x3-y3-z3-color- the triangle colorlineWidth- the line widthframe- frame the triangle
-
-
Method Details
-
draw
public void draw(com.jogamp.opengl.GLAutoDrawable drawable) Description copied from class:Item3DThe custom drawing method -
getSortPoint
public float[] getSortPoint()Description copied from class:Item3DA representative point for transparent sorting, in world coordinates. Default is origin. Override in items with a natural center (Sphere, Cube, Cylinder, etc.).- Overrides:
getSortPointin classItem3D- Returns:
- the sort point as
[x, y, z]
-