vertex()ShapeVertexApplication & Webvertex_.gif
beginShape(POINTS);
vertex(30, 20);
vertex(85, 20);
vertex(85, 75);
vertex(30, 75);
endShape();
vertex_2.gif
noStroke();
BImage a = loadImage("arch.jpg");
beginShape();
texture(a);
// "arch.jpg" is 100x100 pixels in size so
// the values 0 and 100 are used for the
// parameters "u" and "v" to map it directly
// to the vertex points
vertex(10, 20, 0, 0);
vertex(80, 5, 100, 0);
vertex(95, 90, 100, 100);
vertex(40, 95, 0, 100);
endShape();
All shapes are constructed by connecting a series of vertices. vertex() is used to specify the vertex coordinates for points, lines, triangles, quads, and polygons and is used exclusively within the beginShape() and endShape() function. This function is also used to map a texture onto the geometry. The texture() function declares the texture to apply to the geometry and the u and v coordinates set define the mapping of this texture to the form. By default, the coordinates used for u and v are specified in relation to the image's size in pixels, but this relation can be changed with textureMode().
vertex(x, y);
vertex(x, y, z);
vertex(x, y, u, v);
vertex(x, y, z, u, v);
int or float: x-coordinate of the vertexint or float: y-coordinate of the vertexint or float: z-coordinate of the vertexint or float: horizontal coordinate for the texture mappingint or float: vertical coordinate for the texture mappingNone
beginShape()
endShape()
bezierVertex()
curveVertex()
texture()
1.0FunctionCore