|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gwoptics.graphics.Renderable org.gwoptics.graphics.graph3D.SquareGridMesh
public class SquareGridMesh
SquareGridMesh is a square shaped grid with variable resolution along both sides. Each point can have its height set allowing surfaces to be generated. This object is originally designed to work with the SurfaceGraph3D control, but is Usable without this for other purposes.
Each point is coloured according to a supplied IColourmap, solid fill colour or by wireframe. The colour and point positions are both stored in 2 arrays. Default values are a resolution along both sides of 10 squares each 10 units in length.
Important Note: It must be noted that although due to notation the Z axis points upwards, in world space the Y axis points up. Therefore Z <-> Y when it comes to plotting data.
Renderable
,
IColourmap
Field Summary | |
---|---|
GWColour |
fillColour
If no colourmap is provided this is the fill colour for the grid. |
boolean |
isColoured
Specifies whether to use a colourmap to colour each vertex |
boolean |
isFilled
States whether to fill the grid using fillColour. |
boolean |
isStroked
States whether to stroke the grid using strokeColour. |
GWColour |
strokeColour
If no colourmap is provided this is the stroke colour for the grid. |
Fields inherited from class org.gwoptics.graphics.Renderable |
---|
position |
Constructor Summary | |
---|---|
SquareGridMesh(int X,
int Y,
float dx,
float dz,
processing.core.PApplet parent)
Allows user to specify dimensions of the grid needed. |
Method Summary | |
---|---|
void |
draw()
|
float |
getLength()
|
float |
getWidth()
|
float |
getZValue(int X,
int Y)
Returns height of point at index X and Y. |
void |
setVertexColour(int X,
int Y,
GWColour c)
Sets the colour of a given point at indexes X and Y. |
void |
setZValue(int X,
int Y,
float Z)
This function sets the Z value of a given point at X and Y. |
int |
sizeX()
Returns number of squares along X side. |
int |
sizeY()
Returns number of squares along Z side. |
Methods inherited from class org.gwoptics.graphics.Renderable |
---|
setParent |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean isColoured
public GWColour strokeColour
public boolean isFilled
public GWColour fillColour
public boolean isStroked
Constructor Detail |
---|
public SquareGridMesh(int X, int Y, float dx, float dz, processing.core.PApplet parent)
X
- number of squares along the x axisY
- number of squares along the y axisdx
- size of square in x directiondy
- size of square in y directionparent
- PApplet that the grid is rendered inMethod Detail |
---|
public float getWidth()
public float getLength()
public void setZValue(int X, int Y, float Z)
X
- Y
- Z
- public void setVertexColour(int X, int Y, GWColour c)
X
- Y
- c
- public float getZValue(int X, int Y)
public void draw()
draw
in interface IRenderable
draw
in class Renderable
public int sizeX()
public int sizeY()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |