public class PShapeOpenGL extends PShape
Modifier and Type | Field and Description |
---|---|
static int |
DIRECTION |
int |
glUsage |
static int |
NORMAL |
static int |
OFFSET |
static int |
POSITION |
static int |
TEXCOORD |
colorMode, colorModeA, colorModeX, colorModeY, colorModeZ, depth, GEOMETRY, height, INSIDE_BEGIN_END_ERROR, NO_SUCH_VERTEX_ERROR, NO_VERTICES_ERROR, NOT_A_SIMPLE_VERTEX, OUTSIDE_BEGIN_END_ERROR, PATH, PER_VERTEX_UNSUPPORTED, PRIMITIVE, width
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z
Constructor and Description |
---|
PShapeOpenGL(PGraphicsOpenGL pg,
int family) |
PShapeOpenGL(PGraphicsOpenGL pg,
int kind,
float... p)
Create a shape from the PRIMITIVE family, using this kind and these params
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(PShape who) |
void |
addChild(PShape who,
int idx) |
void |
applyMatrix(float n00,
float n01,
float n02,
float n10,
float n11,
float n12) |
void |
applyMatrix(float n00,
float n01,
float n02,
float n03,
float n10,
float n11,
float n12,
float n13,
float n20,
float n21,
float n22,
float n23,
float n30,
float n31,
float n32,
float n33) |
void |
applyMatrix(PMatrix2D source) |
void |
attrib(java.lang.String name,
boolean... values) |
void |
attrib(java.lang.String name,
float... values) |
void |
attrib(java.lang.String name,
int... values) |
void |
attribColor(java.lang.String name,
int color) |
void |
attribNormal(java.lang.String name,
float nx,
float ny,
float nz) |
void |
attribPosition(java.lang.String name,
float x,
float y,
float z) |
void |
bezierDetail(int detail) |
void |
bezierVertex(float x2,
float y2,
float x3,
float y3,
float x4,
float y4) |
void |
bezierVertex(float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float x4,
float y4,
float z4) |
boolean |
contains(float x,
float y)
Return true if this x, y coordinate is part of this shape.
|
static void |
copyGroup(PGraphicsOpenGL pg,
PShape src,
PShape dest) |
static PShapeOpenGL |
createShape(PGraphicsOpenGL pg,
PShape src) |
void |
curveDetail(int detail) |
void |
curveTightness(float tightness) |
void |
curveVertex(float x,
float y) |
void |
curveVertex(float x,
float y,
float z) |
void |
disableStyle()
( begin auto-generated from PShape_disableStyle.xml )
Disables the shape's style data and uses Processing's current styles.
|
void |
draw(PGraphics g)
Called by the following (the shape() command adds the g)
PShape s = loadShape("blah.svg");
shape(s);
|
void |
enableStyle()
( begin auto-generated from PShape_enableStyle.xml )
Enables the shape's style data and ignores Processing's current styles.
|
void |
endShape(int mode) |
int |
getAmbient(int index) |
float |
getDepth()
Get the depth of the shape area (not necessarily the shape boundary).
|
int |
getEmissive(int index) |
int |
getFill(int index) |
float |
getHeight()
Get the height of the drawing area (not necessarily the shape boundary).
|
PVector |
getNormal(int index,
PVector vec) |
float |
getNormalX(int index) |
float |
getNormalY(int index) |
float |
getNormalZ(int index) |
float |
getShininess(int index) |
int |
getSpecular(int index) |
int |
getStroke(int index) |
float |
getStrokeWeight(int index) |
PShape |
getTessellation() |
float[] |
getTessellation(int kind,
int data) |
float |
getTextureU(int index) |
float |
getTextureV(int index) |
int |
getTint(int index) |
PVector |
getVertex(int index,
PVector vec) |
int |
getVertexCode(int index)
One of VERTEX, BEZIER_VERTEX, CURVE_VERTEX, or BREAK.
|
int |
getVertexCodeCount() |
int[] |
getVertexCodes() |
int |
getVertexCount() |
float |
getVertexX(int index) |
float |
getVertexY(int index) |
float |
getVertexZ(int index) |
float |
getWidth()
Get the width of the drawing area (not necessarily the shape boundary).
|
void |
normal(float nx,
float ny,
float nz) |
void |
quadraticVertex(float cx,
float cy,
float x3,
float y3) |
void |
quadraticVertex(float cx,
float cy,
float cz,
float x3,
float y3,
float z3) |
void |
removeChild(int idx)
Remove the child shape with index idx.
|
void |
resetMatrix()
( begin auto-generated from PShape_resetMatrix.xml )
Replaces the current matrix of a shape with the identity matrix.
|
void |
rotate(float angle)
( begin auto-generated from PShape_rotate.xml )
Rotates a shape the amount specified by the angle parameter.
|
void |
rotate(float angle,
float v0,
float v1,
float v2) |
void |
rotateX(float angle)
( begin auto-generated from PShape_rotateX.xml )
Rotates a shape around the x-axis the amount specified by the
angle parameter.
|
void |
rotateY(float angle)
( begin auto-generated from PShape_rotateY.xml )
Rotates a shape around the y-axis the amount specified by the
angle parameter.
|
void |
rotateZ(float angle)
( begin auto-generated from PShape_rotateZ.xml )
Rotates a shape around the z-axis the amount specified by the
angle parameter.
|
void |
scale(float s)
( begin auto-generated from PShape_scale.xml )
Increases or decreases the size of a shape by expanding and contracting
vertices.
|
void |
scale(float x,
float y) |
void |
scale(float x,
float y,
float z) |
void |
setAmbient(int ambient) |
void |
setAmbient(int index,
int ambient) |
void |
setAttrib(java.lang.String name,
int index,
boolean... values) |
void |
setAttrib(java.lang.String name,
int index,
float... values) |
void |
setAttrib(java.lang.String name,
int index,
int... values) |
void |
setEmissive(int emissive) |
void |
setEmissive(int index,
int emissive) |
void |
setFill(boolean fill) |
void |
setFill(int fill)
( begin auto-generated from PShape_setFill.xml )
The setFill() method defines the fill color of a PShape.
|
void |
setFill(int index,
int fill) |
void |
setNormal(int index,
float nx,
float ny,
float nz) |
void |
setParams(float[] source) |
void |
setPath(int vcount,
float[][] verts,
int ccount,
int[] codes) |
void |
setShininess(float shininess) |
void |
setShininess(int index,
float shine) |
void |
setSpecular(int specular) |
void |
setSpecular(int index,
int specular) |
void |
setStroke(boolean stroke) |
void |
setStroke(int stroke)
( begin auto-generated from PShape_setStroke.xml )
The setStroke() method defines the outline color of a PShape.
|
void |
setStroke(int index,
int stroke) |
void |
setStrokeCap(int cap) |
void |
setStrokeJoin(int join) |
void |
setStrokeWeight(float weight) |
void |
setStrokeWeight(int index,
float weight) |
void |
setTexture(PImage tex) |
void |
setTextureMode(int mode) |
void |
setTextureUV(int index,
float u,
float v) |
void |
setTint(boolean tint) |
void |
setTint(int tint) |
void |
setTint(int index,
int tint) |
void |
setVertex(int index,
float x,
float y) |
void |
setVertex(int index,
float x,
float y,
float z) |
void |
setVertex(int index,
PVector vec) |
void |
solid(boolean solid) |
void |
translate(float tx,
float ty)
( begin auto-generated from PShape_translate.xml )
Specifies an amount to displace the shape.
|
void |
translate(float tx,
float ty,
float tz) |
void |
vertex(float x,
float y) |
void |
vertex(float x,
float y,
float z) |
void |
vertex(float x,
float y,
float u,
float v) |
void |
vertex(float x,
float y,
float z,
float u,
float v) |
addName, ambient, ambient, ambient, applyMatrix, applyMatrix, beginContour, beginShape, beginShape, colorMode, colorMode, colorMode, colorMode, emissive, emissive, emissive, endContour, endShape, fill, fill, fill, fill, fill, fill, findChild, getChild, getChild, getChildCount, getChildIndex, getChildren, getFamily, getKind, getName, getNormal, getParam, getParams, getParams, getParent, getVertex, is2D, is3D, isClosed, isVisible, noFill, noStroke, noTexture, noTint, set3D, setFamily, setKind, setName, setPath, setVisible, shininess, specular, specular, specular, stroke, stroke, stroke, stroke, stroke, stroke, strokeCap, strokeJoin, strokeWeight, texture, textureMode, tint, tint, tint, tint, tint, tint
public static final int POSITION
public static final int NORMAL
public static final int TEXCOORD
public static final int DIRECTION
public static final int OFFSET
public int glUsage
public PShapeOpenGL(PGraphicsOpenGL pg, int family)
public PShapeOpenGL(PGraphicsOpenGL pg, int kind, float... p)
public void addChild(PShape who)
addChild
in class PShape
who
- any variable of type PShapePShape.getChild(int)
public void addChild(PShape who, int idx)
public void removeChild(int idx)
PShape
removeChild
in class PShape
public static PShapeOpenGL createShape(PGraphicsOpenGL pg, PShape src)
public static void copyGroup(PGraphicsOpenGL pg, PShape src, PShape dest)
public float getWidth()
PShape
public float getHeight()
PShape
public float getDepth()
PShape
public void setTextureMode(int mode)
setTextureMode
in class PShape
public void setTexture(PImage tex)
setTexture
in class PShape
public void solid(boolean solid)
public void vertex(float x, float y, float z, float u, float v)
public void attribPosition(java.lang.String name, float x, float y, float z)
attribPosition
in class PShape
public void attribNormal(java.lang.String name, float nx, float ny, float nz)
attribNormal
in class PShape
public void attribColor(java.lang.String name, int color)
attribColor
in class PShape
public void attrib(java.lang.String name, boolean... values)
public void setParams(float[] source)
public void setPath(int vcount, float[][] verts, int ccount, int[] codes)
public void translate(float tx, float ty)
PShape
translate
in class PShape
tx
- left/right translationty
- up/down translationPShape.rotate(float)
,
PShape.scale(float)
,
PShape.resetMatrix()
public void translate(float tx, float ty, float tz)
public void rotate(float angle)
PShape
rotate
in class PShape
angle
- angle of rotation specified in radiansPShape.rotateX(float)
,
PShape.rotateY(float)
,
PShape.rotateZ(float)
,
PShape.scale(float)
,
PShape.translate(float, float)
,
PShape.resetMatrix()
public void rotateX(float angle)
PShape
rotateX
in class PShape
angle
- angle of rotation specified in radiansPShape.rotate(float)
,
PShape.rotateY(float)
,
PShape.rotateZ(float)
,
PShape.scale(float)
,
PShape.translate(float, float)
,
PShape.resetMatrix()
public void rotateY(float angle)
PShape
rotateY
in class PShape
angle
- angle of rotation specified in radiansPShape.rotate(float)
,
PShape.rotateX(float)
,
PShape.rotateZ(float)
,
PShape.scale(float)
,
PShape.translate(float, float)
,
PShape.resetMatrix()
public void rotateZ(float angle)
PShape
rotateZ
in class PShape
angle
- angle of rotation specified in radiansPShape.rotate(float)
,
PShape.rotateX(float)
,
PShape.rotateY(float)
,
PShape.scale(float)
,
PShape.translate(float, float)
,
PShape.resetMatrix()
public void rotate(float angle, float v0, float v1, float v2)
public void scale(float s)
PShape
scale
in class PShape
s
- percentate to scale the objectPShape.rotate(float)
,
PShape.translate(float, float)
,
PShape.resetMatrix()
public void scale(float x, float y, float z)
public void applyMatrix(PMatrix2D source)
applyMatrix
in class PShape
public void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12)
applyMatrix
in class PShape
public void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33)
applyMatrix
in class PShape
public void resetMatrix()
PShape
resetMatrix
in class PShape
PShape.rotate(float)
,
PShape.scale(float)
,
PShape.translate(float, float)
public void bezierDetail(int detail)
bezierDetail
in class PShape
public void bezierVertex(float x2, float y2, float x3, float y3, float x4, float y4)
bezierVertex
in class PShape
public void bezierVertex(float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
bezierVertex
in class PShape
public void quadraticVertex(float cx, float cy, float x3, float y3)
quadraticVertex
in class PShape
public void quadraticVertex(float cx, float cy, float cz, float x3, float y3, float z3)
quadraticVertex
in class PShape
public void curveDetail(int detail)
curveDetail
in class PShape
public void curveTightness(float tightness)
curveTightness
in class PShape
public void curveVertex(float x, float y)
curveVertex
in class PShape
public void curveVertex(float x, float y, float z)
curveVertex
in class PShape
public int getVertexCount()
getVertexCount
in class PShape
PShape.getVertex(int)
,
PShape.setVertex(int, float, float)
public float getVertexX(int index)
getVertexX
in class PShape
public float getVertexY(int index)
getVertexY
in class PShape
public float getVertexZ(int index)
getVertexZ
in class PShape
public void setVertex(int index, float x, float y)
setVertex
in class PShape
index
- the location of the vertexx
- the x value for the vertexy
- the y value for the vertexPShape.getVertex(int)
,
PShape.getVertexCount()
public void setVertex(int index, float x, float y, float z)
public void setVertex(int index, PVector vec)
public float getNormalX(int index)
getNormalX
in class PShape
public float getNormalY(int index)
getNormalY
in class PShape
public float getNormalZ(int index)
getNormalZ
in class PShape
public void setNormal(int index, float nx, float ny, float nz)
public void setAttrib(java.lang.String name, int index, float... values)
public void setAttrib(java.lang.String name, int index, int... values)
public void setAttrib(java.lang.String name, int index, boolean... values)
public float getTextureU(int index)
getTextureU
in class PShape
public float getTextureV(int index)
getTextureV
in class PShape
public void setTextureUV(int index, float u, float v)
setTextureUV
in class PShape
public void setFill(int fill)
PShape
public void setStroke(int stroke)
PShape
public float getStrokeWeight(int index)
getStrokeWeight
in class PShape
public void setStrokeWeight(float weight)
setStrokeWeight
in class PShape
public void setStrokeWeight(int index, float weight)
setStrokeWeight
in class PShape
public void setStrokeJoin(int join)
setStrokeJoin
in class PShape
public void setStrokeCap(int cap)
setStrokeCap
in class PShape
public int getAmbient(int index)
getAmbient
in class PShape
public void setAmbient(int ambient)
setAmbient
in class PShape
public void setAmbient(int index, int ambient)
setAmbient
in class PShape
public int getSpecular(int index)
getSpecular
in class PShape
public void setSpecular(int specular)
setSpecular
in class PShape
public void setSpecular(int index, int specular)
setSpecular
in class PShape
public int getEmissive(int index)
getEmissive
in class PShape
public void setEmissive(int emissive)
setEmissive
in class PShape
public void setEmissive(int index, int emissive)
setEmissive
in class PShape
public float getShininess(int index)
getShininess
in class PShape
public void setShininess(float shininess)
setShininess
in class PShape
public void setShininess(int index, float shine)
setShininess
in class PShape
public int[] getVertexCodes()
getVertexCodes
in class PShape
public int getVertexCodeCount()
getVertexCodeCount
in class PShape
public int getVertexCode(int index)
getVertexCode
in class PShape
public PShape getTessellation()
getTessellation
in class PShape
public float[] getTessellation(int kind, int data)
public boolean contains(float x, float y)
PShape
public void disableStyle()
PShape
disableStyle
in class PShape
PShape.enableStyle()
public void enableStyle()
PShape
enableStyle
in class PShape
PShape.disableStyle()