Package toxi.processing
Class ToxiclibsSupport
java.lang.Object
toxi.processing.ToxiclibsSupport
In addition to providing new drawing commands, this class provides wrappers
for using datatypes of the toxiclibs core package directly with Processing's
drawing commands. The class can be configured to work with any PGraphics
instance (incl. offscreen buffers) using a constructor argument or the
setGraphics(PGraphics)
method.-
Constructor Summary
ConstructorDescriptionToxiclibsSupport
(processing.core.PApplet app) ToxiclibsSupport
(processing.core.PApplet app, processing.core.PGraphics gfx) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
final void
final void
chooseStrokeFill
(boolean isWireframe, ReadonlyTColor stroke, ReadonlyTColor fill) final void
final void
final void
final void
final void
final void
cylinder
(AxisAlignedCylinder cylinder) final void
cylinder
(AxisAlignedCylinder cylinder, int res, boolean smooth) final void
final void
fill
(ReadonlyTColor col) final processing.core.PGraphics
final void
final void
line
(Line2D l, Line2DRenderModifier modifier) final void
final void
line
(ReadonlyVec2D a, ReadonlyVec2D b) final void
line
(ReadonlyVec2D a, ReadonlyVec2D b, Line2DRenderModifier modifier) final void
line
(ReadonlyVec3D a, ReadonlyVec3D b) final void
line
(ReadonlyVec4D a, ReadonlyVec4D b) final void
final void
final void
final void
final void
final void
lineStrip2D
(List<? extends Vec2D> points) Draws a 2D line strip using all points in the given list of vectors.final void
lineStrip2D
(List<? extends Vec2D> points, float scale) final void
lineStrip2D
(LineStrip2D strip) final void
lineStrip3D
(List<? extends Vec3D> points) Draws a 3D line strip using all points in the given list of vectors.final void
lineStrip3D
(List<? extends Vec3D> points, float scale) final void
lineStrip3D
(LineStrip3D strip) final void
lineStrip4D
(List<? extends Vec4D> points) Draws a 3D line strip using all points in the given list of 4D vectors.final void
lineStrip4D
(List<? extends Vec4D> points, float scale) final void
Draws a mesh instance using flat shading.final void
Draws a mesh instance.final void
Draws a mesh instance.final void
meshNormalMapped
(Mesh3D mesh, boolean vertexNormals) Draws the given mesh with each face or vertex tinted using its related normal vector as RGB color.final void
meshNormalMapped
(Mesh3D mesh, NormalMapper mapper, boolean vertexNormals) void
origin
(float len) final void
origin
(ReadonlyVec3D o, float len) Draws the major axes from the given point.final void
Draws a square section of a plane at the given size.final void
final void
final void
final void
Draws a 2D point at the given position.final void
Draws a 3D point at the given position.final void
final void
final void
final void
final void
final void
final void
final void
final void
final void
final void
final void
processVertices2D
(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed) final void
processVertices2D
(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed, float scale) final void
processVertices3D
(Iterator<? extends Vec3D> iterator, int shapeID, boolean closed) final void
processVertices3D
(Iterator<? extends Vec3D> iterator, int shapeID, boolean closed, float scale) final void
processVertices4D
(Iterator<? extends Vec4D> iterator, int shapeID, boolean closed) final void
processVertices4D
(Iterator<? extends Vec4D> iterator, int shapeID, boolean closed, float scale) final void
final void
final void
final void
rotate
(float theta, ReadonlyVec3D v) final void
final void
final void
final void
final void
setGraphics
(processing.core.PGraphics gfx) final void
setStrokeFill
(boolean isWireframe, float r, float g, float b) final void
setStrokeFill
(boolean isWireframe, ReadonlyTColor col) final void
final void
final void
stroke
(ReadonlyTColor col) final void
texturedMesh
(Mesh3D mesh, processing.core.PImage tex, boolean smooth) final void
final void
final void
final void
final void
triangle
(Triangle2D tri) final void
triangle
(Triangle2D tri, boolean isFullShape) final void
triangle
(Triangle3D tri) final void
triangle
(Triangle3D tri, boolean isFullShape) final void
final void
final void
final void
-
Constructor Details
-
ToxiclibsSupport
public ToxiclibsSupport(processing.core.PApplet app) -
ToxiclibsSupport
public ToxiclibsSupport(processing.core.PApplet app, processing.core.PGraphics gfx)
-
-
Method Details
-
box
-
box
-
chooseStrokeFill
-
circle
-
cone
-
cone
-
cone
-
cone
-
cylinder
-
cylinder
-
ellipse
-
fill
-
getGraphics
public final processing.core.PGraphics getGraphics()- Returns:
- the gfx
-
line
-
line
-
line
-
line
-
line
-
line
-
line
-
line
-
line
-
line
-
lines2D
-
lines3D
-
lineStrip2D
-
lineStrip2D
Draws a 2D line strip using all points in the given list of vectors.- Parameters:
points
- point list
-
lineStrip2D
-
lineStrip3D
-
lineStrip3D
Draws a 3D line strip using all points in the given list of vectors.- Parameters:
points
- point list
-
lineStrip3D
-
lineStrip4D
Draws a 3D line strip using all points in the given list of 4D vectors. The w component of the vectors is ignored.- Parameters:
points
- point list
-
lineStrip4D
-
mesh
Draws a mesh instance using flat shading.- Parameters:
mesh
-
-
mesh
Draws a mesh instance.- Parameters:
mesh
-smooth
- true to enable gouroud shading (uses vertex normals, which should have been computed beforehand) or false for flat shading
-
mesh
Draws a mesh instance.- Parameters:
mesh
-smooth
- true to enable gouroud shading (uses vertex normals, which should have been computed beforehand) or false for flat shadingnormalLength
- if >0 then face (or vertex) normals are rendered at this length
-
meshNormalMapped
Draws the given mesh with each face or vertex tinted using its related normal vector as RGB color. Normals can also optionally be shown as lines.- Parameters:
mesh
-vertexNormals
- true, if using vertex normals (else face normals only)
-
meshNormalMapped
-
origin
public void origin(float len) -
origin
Draws the major axes from the given point.- Parameters:
o
- origin pointlen
- axis length
-
plane
Draws a square section of a plane at the given size.- Parameters:
plane
- plane to drawsize
- edge length
-
point
-
point
-
point
-
point
Draws a 2D point at the given position.- Parameters:
v
-
-
point
Draws a 3D point at the given position.- Parameters:
v
-
-
point
-
points2D
-
points2D
-
points2D
-
points3D
-
points3D
-
points3D
-
points4D
-
points4D
-
points4D
-
polygon2D
-
processVertices2D
-
processVertices2D
-
processVertices3D
-
processVertices3D
-
processVertices4D
-
processVertices4D
-
ray
-
ray
-
rect
-
rotate
-
scale
-
scale
-
scale
-
scale
-
setGraphics
public final void setGraphics(processing.core.PGraphics gfx) - Parameters:
gfx
- the gfx to set
-
setStrokeFill
public final void setStrokeFill(boolean isWireframe, float r, float g, float b) -
setStrokeFill
-
sphere
-
sphere
-
stroke
-
texturedMesh
-
translate
-
translate
-
translate
-
translate
-
triangle
-
triangle
-
triangle
-
triangle
-
vertex
-
vertex
-
vertex
-
vertex
-