Package processing.core
Class PShapeOBJ
java.lang.Object
processing.core.PShape
processing.core.PShapeOBJ
- All Implemented Interfaces:
PConstants
This class is not part of the Processing API and should not be used
directly. Instead, use loadShape() and methods like it, which will make
use of this class. Using this class directly will cause your code to break
when combined with future versions of Processing.
OBJ loading implemented using code from Saito's OBJLoader library: http://code.google.com/p/saitoobjloader/ and OBJReader from Ahmet Kizilay http://www.openprocessing.org/visuals/?visualID=191
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
Fields inherited from class processing.core.PShape
ambientColor, calcA, calcAi, calcAlpha, calcB, calcBi, calcColor, calcG, calcGi, calcR, calcRi, childCount, children, close, colorMode, colorModeA, colorModeX, colorModeY, colorModeZ, depth, ellipseMode, emissiveColor, family, fill, fillColor, GEOMETRY, height, image, imagePath, INSIDE_BEGIN_END_ERROR, is3D, kind, matrix, name, nameTable, NO_SUCH_VERTEX_ERROR, NO_VERTICES_ERROR, NOT_A_SIMPLE_VERTEX, openContour, openShape, OUTSIDE_BEGIN_END_ERROR, params, parent, PATH, PER_VERTEX_UNSUPPORTED, perVertexStyles, PRIMITIVE, rectMode, setAmbient, shininess, specularColor, sphereDetailU, sphereDetailV, stroke, strokeCap, strokeColor, strokeJoin, strokeWeight, style, textureMode, tint, tintColor, vertexCodeCount, vertexCodes, vertexCount, vertices, visible, widthFields inherited from interface processing.core.PConstants
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BICUBIC, BILINEAR, 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, MACOS, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NEAREST_NEIGHBOR, NORMAL, 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 Summary
ConstructorsModifierConstructorDescriptionPShapeOBJ(PApplet parent, BufferedReader reader) PShapeOBJ(PApplet parent, BufferedReader reader, String basePath) Initializes a new OBJ Object with the given filename.protectedPShapeOBJ(PShapeOBJ.OBJFace face, PShapeOBJ.OBJMaterial mtl, ArrayList<PVector> coords, ArrayList<PVector> normals, ArrayList<PVector> texcoords) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddChildren(ArrayList<PShapeOBJ.OBJFace> faces, ArrayList<PShapeOBJ.OBJMaterial> materials, ArrayList<PVector> coords, ArrayList<PVector> normals, ArrayList<PVector> texcoords) protected static PShapeOBJ.OBJMaterialaddMaterial(String mtlname, ArrayList<PShapeOBJ.OBJMaterial> materials, Map<String, Integer> materialsHash) protected static StringgetBasePath(PApplet parent, String filename) protected static voidparseMTL(PApplet parent, String mtlfn, String path, BufferedReader reader, ArrayList<PShapeOBJ.OBJMaterial> materials, Map<String, Integer> materialsHash) protected static voidparseOBJ(PApplet parent, String path, BufferedReader reader, ArrayList<PShapeOBJ.OBJFace> faces, ArrayList<PShapeOBJ.OBJMaterial> materials, ArrayList<PVector> coords, ArrayList<PVector> normals, ArrayList<PVector> texcoords) protected static intprotected static intMethods inherited from class processing.core.PShape
addChild, addChild, addName, ambient, ambient, ambient, applyMatrix, applyMatrix, applyMatrix, applyMatrix, applyMatrix, attrib, attrib, attrib, attribColor, attribNormal, attribPosition, beginContour, beginContourImpl, beginShape, beginShape, beginTessellation, beginTessellation, bezierDetail, bezierVertex, bezierVertex, checkMatrix, colorCalc, colorCalc, colorCalc, colorCalc, colorCalc, colorCalc, colorCalcARGB, colorMode, colorMode, colorMode, colorMode, contains, copyGeometry, copyGroup, copyImage, copyMatrix, copyPath, copyPrimitive, copyStyles, createShape, crop, curveDetail, curveTightness, curveVertex, curveVertex, disableStyle, draw, drawGeometry, drawGroup, drawImpl, drawPath, drawPrimitive, emissive, emissive, emissive, enableStyle, endContour, endContourImpl, endShape, endShape, endTessellation, fill, fill, fill, fill, fill, fill, findChild, getAmbient, getChild, getChild, getChildCount, getChildIndex, getChildren, getDepth, getEmissive, getFamily, getFill, getHeight, getKind, getName, getNormal, getNormal, getNormalX, getNormalY, getNormalZ, getParam, getParams, getParams, getParent, getShininess, getSpecular, getStroke, getStrokeWeight, getTessellation, getTextureU, getTextureV, getTint, getVertex, getVertex, getVertexCode, getVertexCodeCount, getVertexCodes, getVertexCount, getVertexCount, getVertexX, getVertexY, getVertexZ, getWidth, is2D, is3D, isClosed, isVisible, noFill, normal, noStroke, noTexture, noTint, parseBase64Image, post, pre, quadraticVertex, quadraticVertex, removeChild, resetMatrix, rotate, rotate, rotateX, rotateY, rotateZ, scale, scale, scale, set3D, setAmbient, setAmbient, setEmissive, setEmissive, setFamily, setFill, setFill, setFill, setKind, setName, setNormal, setParams, setPath, setPath, setShininess, setShininess, setSpecular, setSpecular, setStroke, setStroke, setStroke, setStrokeCap, setStrokeJoin, setStrokeWeight, setStrokeWeight, setTexture, setTextureMode, setTextureUV, setTint, setTint, setTint, setVertex, setVertex, setVertex, setVisible, shininess, solid, specular, specular, specular, stroke, stroke, stroke, stroke, stroke, stroke, strokeCap, strokeJoin, strokeWeight, styles, texture, textureMode, tint, tint, tint, tint, tint, tint, translate, translate, vertex, vertex, vertex, vertex
-
Constructor Details
-
PShapeOBJ
Initializes a new OBJ Object with the given filename. -
PShapeOBJ
-
PShapeOBJ
-
PShapeOBJ
protected PShapeOBJ(PShapeOBJ.OBJFace face, PShapeOBJ.OBJMaterial mtl, ArrayList<PVector> coords, ArrayList<PVector> normals, ArrayList<PVector> texcoords)
-
-
Method Details
-
addChildren
protected void addChildren(ArrayList<PShapeOBJ.OBJFace> faces, ArrayList<PShapeOBJ.OBJMaterial> materials, ArrayList<PVector> coords, ArrayList<PVector> normals, ArrayList<PVector> texcoords) -
parseOBJ
protected static void parseOBJ(PApplet parent, String path, BufferedReader reader, ArrayList<PShapeOBJ.OBJFace> faces, ArrayList<PShapeOBJ.OBJMaterial> materials, ArrayList<PVector> coords, ArrayList<PVector> normals, ArrayList<PVector> texcoords) -
parseMTL
protected static void parseMTL(PApplet parent, String mtlfn, String path, BufferedReader reader, ArrayList<PShapeOBJ.OBJMaterial> materials, Map<String, Integer> materialsHash) -
addMaterial
protected static PShapeOBJ.OBJMaterial addMaterial(String mtlname, ArrayList<PShapeOBJ.OBJMaterial> materials, Map<String, Integer> materialsHash) -
rgbaValue
-
rgbaValue
-
getBasePath
-