25.01.2015 Views

Introduction to Renderman The Renderman Pipeline Hello World ...

Introduction to Renderman The Renderman Pipeline Hello World ...

Introduction to Renderman The Renderman Pipeline Hello World ...

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Moving Things Around<br />

Transforms<br />

• In the first example the command Translate is<br />

used <strong>to</strong> move the object 2 in the Z.<br />

• <strong>Renderman</strong> treats +ve Z as going in<strong>to</strong> the<br />

screen (opposite <strong>to</strong> OpenGL)<br />

• <strong>Renderman</strong> (and ribs) work with a Fixed Camera<br />

and the world must be moved <strong>to</strong> be in the<br />

correct position for the fixed camera<br />

• This can be counter intuitive at first but you<br />

soon get used <strong>to</strong> it.<br />

# Example rib 2<br />

Display "Example2.tiff" "file" "rgb"<br />

Projection "perspective"<br />

<strong>World</strong>Begin<br />

Translate 0 0 2<br />

Translate -1 0 0<br />

Sphere 1 -1 1 360<br />

Translate 1 0 0<br />

Sphere 1 -1 1 360<br />

<strong>World</strong>End<br />

J. P. Macey 2006/7 5<br />

J. P. Macey 2006/7 6<br />

Grouping Transforms<br />

Other Affine Transforms<br />

• Scale x y z : scales the current active elements<br />

in x y and z<br />

• Rotate [angle] x y z : rotate around the axis by<br />

[angle] degrees<br />

• To group transforms we use the TransformBegin<br />

and TransformEnd commands<br />

• Identity : res<strong>to</strong>res the transformation matrix <strong>to</strong><br />

what is was before world begin<br />

• <strong>The</strong>se are similar <strong>to</strong> the OpenGL glPushMatrix()<br />

and glPopMatrix() and preserve the current<br />

transformation state<br />

Display "Example3.tiff" "file" "rgb"<br />

Projection "perspective"<br />

<strong>World</strong>Begin<br />

Translate 0 0 2<br />

TransformBegin<br />

Translate -1 0 0<br />

Sphere 1 -1 1 360<br />

TransformEnd<br />

TransformBegin<br />

Translate 1 0 0<br />

Sphere 1 -1 1 360<br />

TransformEnd<br />

<strong>World</strong>End<br />

J. P. Macey 2006/7 7<br />

J. P. Macey 2006/7 8

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

Saved successfully!

Ooh no, something went wrong!