12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

patch2V2 V31.91.8V51.71.61.51.41.31.21.1V1V4V610 0.2 0.4 0.6 0.8 1Notice that each face shares two vertices with the other face (V 1 -V 4 and V 3 -V 5 ).Specifying Vertices and FacesThe Vertices property contains the coordinates of each unique vertex definingthe patch. The Faces property specifies how to connect these vertices to formeach face of the patch. For this example, two vertices share the same locationso you need to specify only four of the six vertices. Each row contains the x, y,and z-coordinates of each vertex.vert = [0 1 1;0 2 1;1 2 1;1 1 1];There are only two faces, defined by connecting the vertices in the orderindicated.fac = [1 2 3;1 3 4];To specify the face colors, define a 2-by-3 matrix containing two RGB colordefinitions.tcolor = [1 1 1;.7 .7 .7];With two faces and two colors, <strong>MATLAB</strong> can color each face with flat shading.This means you must set the FaceColor property to flat, since the faces/vertices technique is available only as a low-level function call (i.e., only byspecifying property name/property value pairs).2-317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!