##RenderMan RIB-Structure 1.0
version 3.03
# Comments appear next to single hash marks (#).
# Display a glass sphere, block, mirror and wall with shadows.
 
# Specify the output file and its size
Display "scm2.tif" "file" "rgba"
Format 640 480 1

# Define the viewpoint
Projection "perspective" "fov" [55 ]
Rotate -12.0 1 0 0
Rotate 43.0 0 1 0
Translate -2.0 0.1 2.0

# Draw one frame, define the world
FrameBegin 1
WorldBegin

# Dont use ambient light - improves contrast in this environment
#LightSource "ambientlight" 1 "intensity" [0.1 ]

# Turn ray-casting shadow calculation on
Attribute "light" "shadows" ["on"]

# 3 light sources
LightSource "distantlight" 2 "intensity" [1 ] "lightcolor" [1 1 1] "from" [0 100 -20] "to" [0 0 0]
LightSource "distantlight" 3 "intensity" [2 ] "lightcolor" [1 1 1] "from" [30 30 30] "to" [0 0 0]
LightSource "distantlight" 4 "intensity" [2 ] "lightcolor" [1 1 1] "from" [50 30 -20] "to" [0 0 0]

# A glass ball
AttributeBegin
Attribute "identifier" "name" "myball"
Surface "glass"
Sphere 0.5 -0.5 0.5 360
AttributeEnd

# A mirror behind the ball
AttributeBegin
Attribute "identifier" "name" "mymirror"
Surface "shiny"
Translate 0.0 -0.5 1.0
  TransformBegin
  Polygon "P" [1 1 0  -1 1 0  -1 -1 0  1 -1 0]
  TransformEnd
AttributeEnd

# A brick wall
AttributeBegin
Attribute "identifier" "name" "backwall"
Declare "brickwidth" "float"
Declare "brickheight" "float"
Surface "brick" "brickwidth" .3 "brickheight" 0.1
Translate -1.0 -0.5 0.0
  TransformBegin
  Rotate 90 0 1 0 
  Polygon "P" [1 1 0  -1 1 0  -1 -1 0  1 -1 0]
  TransformEnd
AttributeEnd

# A carpet on the floor
AttributeBegin
Attribute "identifier" "name" "floor"
Surface "carpet"
Translate 0.0 -1.5 0.0
  TransformBegin
  Rotate 90 1 0 0
  Polygon "P" [1 1 0  -1 1 0  -1 -1 0  1 -1 0]
  TransformEnd
AttributeEnd

# A block made of (Pixar) wood
AttributeBegin
Attribute "identifier" "name" "myblock"
Color [0.60 0.4 0.26]
  TransformBegin
  Scale 0.5 0.5 0.5
  Surface "wood"
  TransformEnd
Translate 0 -1.0 0
# A cube with unit length sides, centered at the origin
Bound -.5 .5 -.5 .5 -.5 .5
  TransformBegin
  # far face
  Polygon "P" [.5 .5 .5  -.5 .5 .5  -.5 -.5 .5  .5 -.5 .5]
  Rotate 90  0 1 0
  # right face
  Polygon "P" [.5 .5 .5  -.5 .5 .5  -.5 -.5 .5  .5 -.5 .5]
  # near face
  Rotate 90  0 1 0
  Polygon "P" [.5 .5 .5  -.5 .5 .5  -.5 -.5 .5  .5 -.5 .5]
  # left face
  Rotate 90  0 1 0
  Polygon "P" [.5 .5 .5  -.5 .5 .5  -.5 -.5 .5  .5 -.5 .5]
  TransformEnd
  TransformBegin
  # bottom face
  Rotate 90  1 0 0
  Polygon "P" [.5 .5 .5  -.5 .5 .5  -.5 -.5 .5  .5 -.5 .5]
  TransformEnd
  TransformBegin
  # top face
  Rotate -90  1 0 0
  Polygon "P" [.5 .5 .5  -.5 .5 .5  -.5 -.5 .5  .5 -.5 .5]
  TransformEnd
AttributeEnd

WorldEnd
FrameEnd