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.

xmin = clamp (ceil ( xresolution*xmin ), 0, xresolution-1);<br />

rxmax = clamp (ceil ( xresolution*xmax -1 ), 0, xresolution-1);<br />

rymin = clamp (ceil ( yresolution*ymin ), 0, yresolution-1);<br />

rymax = clamp (ceil ( yresolution*ymax -1 ), 0, yresolution-1);<br />

<strong>The</strong>se regions are defined so that if a large image is generated with tiles of abutting<br />

but non-overlapping crop windows, the subimages produced will tile the display<br />

with abutting and non-overlapping regions.<br />

RIB BINDING<br />

Cropwindow xmin xmax ymin ymax<br />

Cropwindow [xmin xmax ymin ymax]<br />

EXAMPLE<br />

RiCropWindow (0.0, 0.3, 0.0, 0.5);<br />

SEE ALSO<br />

RiFrameAspectRatio, RiFormat<br />

RiProjection ( RtToken name, ...parameterlist...)<br />

<strong>The</strong> projection determines how camera coordinates are converted to screen coordinates,<br />

using the type of projection and the near/far clipping planes to generate a<br />

projection matrix. It appends this projection matrix to the current transformation matrix<br />

and stores this as the screen transformation, then marks the current coordinate<br />

system as the camera coordinate system and reinitializes the current transformation<br />

matrix to the identity camera transformation. <strong>The</strong> required types of projection are<br />

”perspective”, ”orthographic”, and RI NULL.<br />

”perspective” builds a projection matrix that does a perspective projection along the<br />

z-axis, using the RiClipping values, so that points on the near clipping plane project<br />

to z = 0 and points on the far clipping plane project to z = 1. ”perspective” takes one<br />

optional parameter, ”fov”, a single RtFloat that indicates he full angle perspective field<br />

of view (in degrees) between screen space coordinates (-1,0) and (1,0) (equivalently<br />

between (0,-1) and (0,1)). <strong>The</strong> default is 90 degrees.<br />

Note that there is a redundancy in the focal length implied by this procedure and the<br />

one set by RiDepthOfField. <strong>The</strong> focal length implied by this command is:<br />

focallength = horizontalscreenwidth ( ) fov<br />

verticalscreenwidth<br />

/ tan 2<br />

”orthographic” builds a simple orthographic projection that scales z using the RiClipping<br />

values as above. ”orthographic” takes no parameters.<br />

RI NULL uses an identity projection matrix, and simply marks camera space in situations<br />

where the user has generated his own projection matrices himself using RiPerspective<br />

or RiTransform.<br />

This command can also be used to select implementation-specific projections or special<br />

projections written in the Shading Language. If a particular implementation does<br />

25

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

Saved successfully!

Ooh no, something went wrong!