|
Shapes 3D
3.0
|

Public Member Functions | |
| void | texture (PImage image) |
| void | movie (PApplet pApplet, PImage movie) |
| _ShapePart | uv (float u0, float u1, float v0, float v1) |
| _ShapePart | mesh (int nbrColSlices, int nbrRowSlices) |
| _ShapePart | uvt (TransformUV transformer) |
| _ShapePart | uvwrap (int wrap) |
| void | visible (boolean visible) |
| _ShapePart | fill (int fillColor) |
| _ShapePart | stroke (int col) |
| _ShapePart | strokeWeight (float weight) |
| _ShapePart | drawMode (int mode) |
| abstract void | draw (PGraphics pg) |
| abstract void | drawPickBuffer (PGraphics pg) |
| boolean | isVisible () |
| float | strokeWeight () |
| int | fill () |
| int | stroke () |
| int | drawMode () |
| PImage | texture () |
Public Attributes | |
| String | tag |
Public Attributes inherited from shapes3d.utils.SConstants | |
| int | WIRE = 0x00000011 |
| int | SOLID = 0x00000012 |
| int | TEXTURE = 0x00000014 |
| int | DRAWALL = WIRE | SOLID | TEXTURE |
| int | WHITE = 0xFFFFFFFF |
| int | BLACK = 0xFF000000 |
| int | GREY = 0xFFC0C0C0 |
| int | RED = 0xFFFF0000 |
| int | GREEN = 0xFF00FF00 |
| int | BLUE = 0xFF0000FF |
| int | YELLOW = 0xFFFFFF00 |
| int | PURPLE = 0xFFFF00FF |
| int | CYAN = 0xFF00FFFF |
| int | ORANGE = 0xFFFFC000 |
| int | CW = 1 |
| int | CCW = 2 |
| int | ALL = 0b11111111 |
| int | BOTTOM = 0b00000001 |
| int | TOP = 0b00000010 |
| int | FRONT = 0b00000100 |
| int | BACK = 0b00001000 |
| int | LEFT = 0b00010000 |
| int | RIGHT = 0b00100000 |
| int | BODY = 0b00000001 |
| int | END0 = 0b00000010 |
| int | END1 = 0b00000100 |
| float | ONE_DEG_T = (float) (Math.PI / 180.0) |
| PathOrthogonal | ORTHO_X = new PathOrthogonal.PathNormalX() |
| PathOrthogonal | ORTHO_Y = new PathOrthogonal.PathNormalY() |
| PathOrthogonal | ORTHO_Z = new PathOrthogonal.PathNormalZ() |
| PathOrthogonal | ORTHO_A = new PathOrthogonal.PathNormalAMC() |
| TransformUV | ROT_0 = TransformUV.ROT0 |
| TransformUV | ROT_90 = TransformUV.ROT90 |
| TransformUV | ROT_180 = TransformUV.ROT180 |
| TransformUV | ROT_270 = TransformUV.ROT270 |
| TransformUV | FLIP_H = TransformUV.FLIPH |
| TransformUV | FLIP_V = TransformUV.FLIPV |
| Rotation | ROTATION_ZERO = new Rotation() |
| int | T_BOX = 0x1001 |
| int | T_DOME = 0x1002 |
| int | T_CONE = 0x1003 |
| int | T_ELLIPSOID = 0x1004 |
| int | T_EXTRUSION = 0x1005 |
| int | T_LATHESTOCK = 0x1006 |
| int | T_MD2 = 0x1007 |
| int | T_SKYBOX = 0x1008 |
| int | T_SKYDOME = 0x1009 |
| int | T_TERRAIN = 0x100A |
| int | T_TUBE = 0x100B |
| int | C_LATHESURFACE = 0x2001 |
| int | C_OVAL = 0x2002 |
| int | C_POLYGON = 0x2003 |
| int | P_BCURVE2D = 0x3001 |
| int | P_BCURVE3D = 0x3002 |
| int | P_BSPLINE2D = 0x3003 |
| int | P_BSPLINE3D = 0x3004 |
| int | P_LINEAR = 0x3005 |
| int | P_LISSAJOUS = 0x3006 |
| int | P_RING = 0x3007 |
| int | P_SPIRAL = 0x3008 |
Protected Member Functions | |
| _ShapePart (int ppCol) | |
| _ShapePart (int ppCol, String tag) | |
| abstract _ShapePart | applyUV () |
| void | drawWhat () |
| boolean | isValidDrawMode (int mode) |
Protected Attributes | |
| int | fillColor = BLUE |
| int | strokeColor = YELLOW |
| float | strokeWeight = 2.0f |
| int | drawMode = SOLID | WIRE |
| boolean | visible = true |
| boolean | useSolid |
| boolean | useWire |
| boolean | useTexture |
| PImage | skin = null |
| TransformUV | transformer = TransformUV.ROT0 |
| float | u0 = 0 |
| float | u1 = 1 |
| float | v0 = 0 |
| float | v1 = 1 |
| int | wrap = REPEAT |
| final int | partPickColor |
Some shapes can't be drawn with a single mesh, so these shapes have multiple parts. For instance a Tube has 3 parts the main curved body and the two end caps.
This class represents a single shape part. It is the parent class for all shape parts.
|
protected |
Base ctor for all shape parts
| ppCol | the pick color |
|
protected |
Base ctor for all parts
| ppCol | the pick color |
| tag | user defined identifier. |
|
pure virtual |
Draw this part on to a graphics context
| pg | the graphics context |
Implemented in shapes3d._MD2mesh, shapes3d._TerrainMesh2D, and shapes3d._FlatMesh2D.
| _ShapePart shapes3d._ShapePart.drawMode | ( | int | mode | ) |
Sets the draw mode of this shape part
| mode | the drawMode to set |
| int shapes3d._ShapePart.drawMode | ( | ) |
|
pure virtual |
Draw this part on to a graphics context
| pg | the pick buffer graphics context |
Implemented in shapes3d._MD2mesh, shapes3d._TerrainMesh2D, and shapes3d._FlatMesh2D.
|
protected |
Used internally to convert drawmode into 3 boolean values for the three draw modes.
| _ShapePart shapes3d._ShapePart.fill | ( | int | fillColor | ) |
Sets the fill color of this shape part
| fillColor | the fillColor to set |
| int shapes3d._ShapePart.fill | ( | ) |
|
protected |
Used internally to check the validity of an integer value as a draw mode
| boolean shapes3d._ShapePart.isVisible | ( | ) |
| _ShapePart shapes3d._ShapePart.mesh | ( | int | nbrColSlices, |
| int | nbrRowSlices | ||
| ) |
This provides the default implementation for shape parts which is do nothing.
| nbrColSlices | number of slices in x direction |
| nbrRowSlices | number of slices in direction orthogonal to x |
| void shapes3d._ShapePart.movie | ( | PApplet | pApplet, |
| PImage | movie | ||
| ) |
Apply movie as texture.
| pApplet | gives access to Processing methods/functions |
| movie | the movie to use as the texture |
| _ShapePart shapes3d._ShapePart.stroke | ( | int | col | ) |
Sets the stroke color of this shape part
| col | the strokeColor to set |
| int shapes3d._ShapePart.stroke | ( | ) |
| _ShapePart shapes3d._ShapePart.strokeWeight | ( | float | weight | ) |
Sets the stroke weight of this shape part
| weight | the strokeWeight to set |
| float shapes3d._ShapePart.strokeWeight | ( | ) |
| void shapes3d._ShapePart.texture | ( | PImage | image | ) |
Apply image as texture
| image | the image to set |
| PImage shapes3d._ShapePart.texture | ( | ) |
| _ShapePart shapes3d._ShapePart.uv | ( | float | u0, |
| float | u1, | ||
| float | v0, | ||
| float | v1 | ||
| ) |
Set the texture coordinates.
| u0 | horizontal left coordinate |
| u1 | horizontal right coordinate |
| v0 | vertical left coordinate |
| v1 | vertical right coordinate |
| _ShapePart shapes3d._ShapePart.uvt | ( | TransformUV | transformer | ) |
Transform the texture [uv] coordinates
| transformer | the uv transformer object |
| _ShapePart shapes3d._ShapePart.uvwrap | ( | int | wrap | ) |
set the texture wrap attribute. The parameter must be either REPEAT or CLAMP, any other value will be ignored.
| wrap | REPEAT or CLAMP |
| void shapes3d._ShapePart.visible | ( | boolean | visible | ) |
Sets the visibility of this shape part
| visible | the visible to set |