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.

Coordinate System<br />

”shader”<br />

”current”<br />

string<br />

Description<br />

<strong>The</strong> coordinate system in which the shader was defined. This<br />

is the ”object” coordinate system when the shader is defined.<br />

<strong>The</strong> coordinate system in which the shading calculations are<br />

being performed. This is implementation-dependent, but is<br />

usually either the ”camera” or ”world” coordinate system.<br />

A named coordinate system established using RiCoordinateSystem.<br />

Table 11.2: Point coordinate systems.<br />

vector R;<br />

normal Nf;<br />

<strong>The</strong> initialization value may be any scalar or point-like expression. If a scalar expression is<br />

used, the value is promoted to a point (or vector or normal) by duplicating its value into<br />

each component.<br />

Point, vector, and normal constants default to be in the ”current” coordinate system. Points,<br />

vectors, and normals can be specified in any known coordinate system with:<br />

point [space] (x,y,z)<br />

vector [space] (x,y,z)<br />

normal [space] (x,y,z)<br />

where the space is a string literal containing the name of the coordinate system. For example,<br />

point ”world” (0,0,0)<br />

defines a point at the position (0,0,0) in world coordinates. This point is implicitly transformed<br />

to the ”current” coordinate system. And similarly,<br />

vector ”object” (0,0,1)<br />

defines a vector pointing toward the +z axis in ”object” space, which is implicitly transformed<br />

into the equivalent vector expressed in the ”current” coordinate system. Points,<br />

vectors, and normals passed through the <strong>RenderMan</strong> <strong>Interface</strong> are interpreted to be in<br />

”shader” or ”object” space, depending on whether the variable was set using a shader command<br />

or a geometric primitive command, respectively. All points, vectors, and normals<br />

passed through the <strong>RenderMan</strong> <strong>Interface</strong> are transformed to the ”current” coordinate system<br />

before shader execution begins.<br />

11.4 Transformation Matrices<br />

<strong>The</strong> Shading Language has a matrix type that represents the transformation matrix required<br />

to transform points and vectors from one coordinate system and another. Matrices are<br />

represented internally by 16 floats (a 4 × 4 homogeneous transformation matrix).<br />

116

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

Saved successfully!

Ooh no, something went wrong!