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.

significant byte to least significant byte.<br />

Defining RI requests. Before an encoded request can be used, it must first be bound to its<br />

ASCII equivalent with:<br />

0314 | | <br />

where the code is one byte and string is the ASCII form of the request.<br />

Referencing defined RI requests. A previously defined RI request is referenced with two<br />

bytes; a prefixing token, 0246, followed by a request code.<br />

0246 | <br />

This means that no more than 256 RI requests can be directly encoded in the binary protocol.<br />

Example. Consider the following sequence of RIB commands:<br />

version 3.03<br />

ErrorHandler ”print”<br />

Display ”test.25.pic” ”file” ”rgba”<br />

Format 512 307 1<br />

Clipping 0.1 10000<br />

WorldBegin<br />

Declare ”direction” ”point”<br />

LightSource ”windowlight” 0 ”direction” [1 0 -0.1]<br />

Color [1 1 1]<br />

Orientation ”lh”<br />

Sides 1<br />

AttributeBegin<br />

MotionBegin [0 1]<br />

Translate 1.91851 0.213234 1.55<br />

Sphere 2 -0.3 1.95 175<br />

MotionEnd<br />

AttributeEnd<br />

This could translate into the encoded sequence of bytes shown in Figure C.1.<br />

Version Number<br />

<strong>The</strong> RIB stream supports a special version request that is used internally to ensure that the<br />

syntax of the stream is compatible with the parser being used.<br />

version num<br />

Specifies the protocol version number of the RIB stream. <strong>The</strong> stream<br />

specified in this document is version 3.03. A RIB parser may refuse to<br />

parse streams with incompatible version numbers.<br />

179

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

Saved successfully!

Ooh no, something went wrong!