org.gwoptics.graphics.graph3D
Class Axis3D

java.lang.Object
  extended by org.gwoptics.graphics.Renderable
      extended by org.gwoptics.graphics.graph3D.Axis3D
All Implemented Interfaces:
IRenderable, processing.core.PConstants

public class Axis3D
extends Renderable
implements processing.core.PConstants

Axis3D class produces 3D axes with many variable properties to suite any need. The axis can be be directed in any direction ,though it is more common to use <1,0,0>, <0,1,0> or <0,0,1>, using setAxesDirection(). The axis has full tick functionality using both major and minor ticks, with labels for values along the axis shown for each major tick. As the axis is 3D you must specify which plane the labels and ticks must be drawn using setLabelDirection(). Unless strange looking axes are required it is recommended to use a label direction which is orthogonal to the axis direction. As Axis3D extends Renderable it has a position member which can be used to position where the axis is. Both the axis label and tick labels can be rotated using the given functions to generate the required layout of the axis. History Version 0.3.8 Added billboarding to the tick labels, must be used with Camera3D class though.

Since:
0.1.1
Author:
Daniel Brown 8/6/09

Field Summary
 
Fields inherited from class org.gwoptics.graphics.Renderable
position
 
Fields inherited from interface processing.core.PConstants
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Constructor Summary
Axis3D(processing.core.PApplet parent)
           
 
Method Summary
 void draw()
          This function starts rendering the axis to the properties that have been specified.
 float getLength()
          returns the length of the axis in world space.
 float getMaxValue()
          returns the maximum value of the axis range
 float getMinValue()
          returns the minimum value of the axis range
 void setAxesDirection(processing.core.PVector uv)
           
 void setAxisColour(GWColour c)
           
 void setAxisColour(int R, int G, int B)
           
 void setAxisLabel(java.lang.String lbl)
           
 void setDraw(boolean value)
           
 void setDrawAxisLabel(boolean value)
           
 void setDrawLine(boolean value)
           
 void setDrawTickLabels(boolean value)
           
 void setDrawTicks(boolean value)
           
 void setFontColour(GWColour c)
           
 void setFontColour(int R, int G, int B)
           
 void setLabelDirection(processing.core.PVector vlbl)
           
 void setLabelOffset(float val)
           
 void setLabelXRotation(float val)
           
 void setLabelYRotation(float val)
           
 void setLabelZRotation(float val)
           
 void setLength(float l)
           
 void setMajorTickLength(int val)
          Sets the length of the major ticks, using a negative length extends ticks into the graph rather than to the labels
 void setMajorTicks(int t)
           
 void setMaxValue(float val)
           
 void setMinorTickLength(int val)
          Sets the length of the minor ticks, using a negative length extends ticks into the graph rather than to the labels
 void setMinorTicks(int t)
           
 void setMinValue(float val)
           
 void setTickLabelAccuracy(int v)
           
 void setTickLabelBillboarding(boolean value)
           
 void setTickLabelType(ValueType v)
           
 void setTickLabelXRotation(float val)
           
 void setTickLabelYRotation(float val)
           
 void setTickLabelZRotation(float val)
           
 
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
 

Constructor Detail

Axis3D

public Axis3D(processing.core.PApplet parent)
Method Detail

setAxisColour

public void setAxisColour(int R,
                          int G,
                          int B)

setAxisColour

public void setAxisColour(GWColour c)

setFontColour

public void setFontColour(int R,
                          int G,
                          int B)

setFontColour

public void setFontColour(GWColour c)

setTickLabelBillboarding

public void setTickLabelBillboarding(boolean value)

setDraw

public void setDraw(boolean value)

setDrawLine

public void setDrawLine(boolean value)

setDrawTicks

public void setDrawTicks(boolean value)

setDrawTickLabels

public void setDrawTickLabels(boolean value)

setDrawAxisLabel

public void setDrawAxisLabel(boolean value)

setAxisLabel

public void setAxisLabel(java.lang.String lbl)

setLabelOffset

public void setLabelOffset(float val)

setTickLabelXRotation

public void setTickLabelXRotation(float val)

setTickLabelYRotation

public void setTickLabelYRotation(float val)

setTickLabelZRotation

public void setTickLabelZRotation(float val)

setLabelXRotation

public void setLabelXRotation(float val)

setLabelYRotation

public void setLabelYRotation(float val)

setLabelZRotation

public void setLabelZRotation(float val)

setLabelDirection

public void setLabelDirection(processing.core.PVector vlbl)

setAxesDirection

public void setAxesDirection(processing.core.PVector uv)

setMajorTicks

public void setMajorTicks(int t)

setMinorTicks

public void setMinorTicks(int t)

setTickLabelType

public void setTickLabelType(ValueType v)

setTickLabelAccuracy

public void setTickLabelAccuracy(int v)

setMajorTickLength

public void setMajorTickLength(int val)
Sets the length of the major ticks, using a negative length extends ticks into the graph rather than to the labels

Parameters:
val - length of the major ticks

setMinorTickLength

public void setMinorTickLength(int val)
Sets the length of the minor ticks, using a negative length extends ticks into the graph rather than to the labels

Parameters:
val - length of the major ticks

setMaxValue

public void setMaxValue(float val)

setMinValue

public void setMinValue(float val)

setLength

public void setLength(float l)

getMaxValue

public float getMaxValue()
returns the maximum value of the axis range


getMinValue

public float getMinValue()
returns the minimum value of the axis range


getLength

public float getLength()
returns the length of the axis in world space.


draw

public void draw()
This function starts rendering the axis to the properties that have been specified.

Specified by:
draw in interface IRenderable
Specified by:
draw in class Renderable


processing library gwoptics by Daniel Brown and Andreas Freise. (c) 2009 onwards