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
ConstructorsConstructorDescriptionToxiclibsSupport(processing.core.PApplet app) ToxiclibsSupport(processing.core.PApplet app, processing.core.PGraphics gfx) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidfinal voidchooseStrokeFill(boolean isWireframe, ReadonlyTColor stroke, ReadonlyTColor fill) final voidfinal voidfinal voidfinal voidfinal voidfinal voidcylinder(AxisAlignedCylinder cylinder) final voidcylinder(AxisAlignedCylinder cylinder, int res, boolean smooth) final voidfinal voidfill(ReadonlyTColor col) final processing.core.PGraphicsfinal voidfinal voidline(Line2D l, Line2DRenderModifier modifier) final voidfinal voidline(ReadonlyVec2D a, ReadonlyVec2D b) final voidline(ReadonlyVec2D a, ReadonlyVec2D b, Line2DRenderModifier modifier) final voidline(ReadonlyVec3D a, ReadonlyVec3D b) final voidline(ReadonlyVec4D a, ReadonlyVec4D b) final voidfinal voidfinal voidfinal voidfinal voidfinal voidlineStrip2D(List<? extends Vec2D> points) Draws a 2D line strip using all points in the given list of vectors.final voidlineStrip2D(List<? extends Vec2D> points, float scale) final voidlineStrip2D(LineStrip2D strip) final voidlineStrip3D(List<? extends Vec3D> points) Draws a 3D line strip using all points in the given list of vectors.final voidlineStrip3D(List<? extends Vec3D> points, float scale) final voidlineStrip3D(LineStrip3D strip) final voidlineStrip4D(List<? extends Vec4D> points) Draws a 3D line strip using all points in the given list of 4D vectors.final voidlineStrip4D(List<? extends Vec4D> points, float scale) final voidDraws a mesh instance using flat shading.final voidDraws a mesh instance.final voidDraws a mesh instance.final voidmeshNormalMapped(Mesh3D mesh, boolean vertexNormals) Draws the given mesh with each face or vertex tinted using its related normal vector as RGB color.final voidmeshNormalMapped(Mesh3D mesh, NormalMapper mapper, boolean vertexNormals) voidorigin(float len) final voidorigin(ReadonlyVec3D o, float len) Draws the major axes from the given point.final voidDraws a square section of a plane at the given size.final voidfinal voidfinal voidfinal voidDraws a 2D point at the given position.final voidDraws a 3D point at the given position.final voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidprocessVertices2D(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed) final voidprocessVertices2D(Iterator<? extends Vec2D> iterator, int shapeID, boolean closed, float scale) final voidprocessVertices3D(Iterator<? extends Vec3D> iterator, int shapeID, boolean closed) final voidprocessVertices3D(Iterator<? extends Vec3D> iterator, int shapeID, boolean closed, float scale) final voidprocessVertices4D(Iterator<? extends Vec4D> iterator, int shapeID, boolean closed) final voidprocessVertices4D(Iterator<? extends Vec4D> iterator, int shapeID, boolean closed, float scale) final voidfinal voidfinal voidfinal voidrotate(float theta, ReadonlyVec3D v) final voidfinal voidfinal voidfinal voidfinal voidsetGraphics(processing.core.PGraphics gfx) final voidsetStrokeFill(boolean isWireframe, float r, float g, float b) final voidsetStrokeFill(boolean isWireframe, ReadonlyTColor col) final voidfinal voidfinal voidstroke(ReadonlyTColor col) final voidtexturedMesh(Mesh3D mesh, processing.core.PImage tex, boolean smooth) final voidfinal voidfinal voidfinal voidfinal voidtriangle(Triangle2D tri) final voidtriangle(Triangle2D tri, boolean isFullShape) final voidtriangle(Triangle3D tri) final voidtriangle(Triangle3D tri, boolean isFullShape) final voidfinal voidfinal voidfinal 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
-