26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

RIB BINDING<br />

Polygon ...parameterlist...<br />

<strong>The</strong> number of vertices in the polygon is determined implicitly by the number of<br />

elements in the required position array.<br />

EXAMPLE<br />

RtPoint points[4] = ( 0.0, 1.0, 0.0, 0.0, 1.0, 1.0,<br />

0.0, 0.0, 1.0, 0.0, 0.0, 0.0);<br />

RiPolygon(4, RI P, (RtPointer)points, RI NULL);<br />

SEE ALSO<br />

RiGeneralPolygon, RiPointsGeneralPolygons, RiPointsPolygons<br />

An example of the definition of a “Gouraud-shaded” polygon is:<br />

RtPoint points[4];<br />

RtColor colors[4];<br />

RiPolygon( 4, ”P”, (RtPointer)points, ”Cs”, (RtPointer)colors, RI NULL);<br />

A “Phong-shaded” polygon is given by:<br />

RtPoint points[4];<br />

RtPoint normals[4];<br />

RiPolygon( 4, ”P”, (RtPointer)points, ”N”, (RtPointer)normals, RI NULL);<br />

RiGeneralPolygon ( RtInt nloops, RtInt nvertices[], ...parameterlist...)<br />

Define a general planar concave polygon with holes. This polygon is specified by<br />

giving nloops lists of vertices. <strong>The</strong> first loop is the outer boundary of the polygon;<br />

all additional loops are holes. <strong>The</strong> array nvertices contains the number of vertices in<br />

each loop, and has length nloops. <strong>The</strong> vertices in all the loops are concatenated into<br />

a single vertex array. <strong>The</strong> length of this array, n, is equal to the sum of all the values<br />

in the array nvertices.<br />

parameterlist is a list of token-array pairs where each token is one of the standard<br />

geometric primitive variables or a variable that has been defined with RiDeclare. <strong>The</strong><br />

parameter list must include at least position (”P”) information. If a primitive variable<br />

is of class vertex or varying, the array contains n elements of the type corresponding<br />

to the token. If the variable is uniform or constant, there is a single element of that<br />

type. <strong>The</strong> number of floats associated with each type is given in Table 5.1, Standard<br />

Geometric Primitive Variables. <strong>The</strong> interpretation of these variables is the same as for<br />

a convex polygon.<br />

65

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

Saved successfully!

Ooh no, something went wrong!