Working with the PShape Class
In this chapter, we’ll use Processing’s PShape features for all the projects we’ll create.[278] We can use the class to load 2D vector shape files (svg) and 3D object files (obj) and work with 3D vertices generated algorithmically. Let’s take a look at the methods we’ll use to load and create the 3D scenes in this chapter.
loadShape[279] |
load a Scalable Vector Graphic, or svg, file into a PShape object |
beginShape[280] |
start recording a shape using vertices—we can connect vertices with the following modes: POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, and QUAD_STRIP. |
endShape[281] |
stop recording a shape using vertices |
vertex[282] |
add a vertex point to a shape using either x and y values or ... |
Get Rapid Android Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.