##RenderMan RIB-Structure 1.0
version 3.03
# Nancy Kiang - cs184-bf
# CS 184  Lab 7

#A world on a glass platform, partially encircled by a wood screen,
# with geometric objects of different surfaces.

# Specify output file and its size
Display "lab7.tif" "file" "rgba"
Format 640 480 1

# Viewpoint
Projection "perspective" "fov" [55 ]
#These transforms move the WORLD, NOT the VIEWER
#Rotate -12.4214 1 0 0
#Rotate 23.9625 0 1 0
#Translate -0.7410 -0.145 5.0
Rotate -15 1 0 0
#Rotate 22.5 0 1 0
Translate 0.0 -0.5 5.25

# Define the world, one frame
FrameBegin 1
WorldBegin

#Light sources
LightSource "ambientlight" 1 "intensity" [0.4 ] "lightcolor" [1 1 1] 

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

#Beam light sources
LightSource "distantlight" 2 "intensity" [1 ] "lightcolor" [1 0.3 0.3] "from" [0 100 -200] "to" [0 0 0]
LightSource "distantlight" 3 "intensity" [1 ] "lightcolor" [0.3 1 0.3] "from" [200 10 0] "to" [0 0 0]
LightSource "distantlight" 4 "intensity" [1 ] "lightcolor" [0.3 0.3 1] "from" [-50 10 200] "to" [0 0 0]
LightSource "distantlight" 5 "intensity" [1.5 ] "lightcolor" [1 1 1] "from" [10 100 -100] "to" [0 0 0]
LightSource "distantlight" 6 "intensity" [1 ] "lightcolor" [1 1 1] "from" [0 0 0] "to" [0 100 100]


#Sphere - A metallic ball resting on the ground
AttributeBegin
Attribute "identifier" "name" "ball1"
Color [0.1 0.6 0.6]
Declare "roughness" "float"
#Surface "shinymetal" "Ks" 1.0 "Kd" 0.1 "Kr" 0.5 
Surface "rsmetal"
Translate 1.414 -1.7 -1.414
	TransformBegin
	Sphere 0.3 -0.3 0.3 360
	TransformEnd
AttributeEnd

#Sphere - A glass ball resting on the ground
AttributeBegin
Attribute "identifier" "name" "ball2"
#Color [1.0 1.0 1.0]
Surface "glass"
Translate -1.0 -1.5 -2.0
	TransformBegin
	Sphere 0.5 -0.5 0.5 360
	TransformEnd
AttributeEnd

#Sphere - A glass ball floating above the cone
AttributeBegin
Attribute "identifier" "name" "ball3"
#Color [1.0 1.0 1.0]
Surface "glass"
Translate 0.0 0.5 0.0
	TransformBegin
	Sphere 0.25 -0.25 0.25 360
	TransformEnd
AttributeEnd

#Cone - inverted, at the origin
AttributeBegin
Attribute "identifier" "name" "cone1"
Color [0.4 0.5 0.7]
Surface "cmarble"
Displacement "ripple"
	TransformBegin
	Rotate 90 1 0 0
	Cone 2 0.25 360
	TransformEnd
AttributeEnd

#Cylinder - a partial cylinder enclosing the world
AttributeBegin
Attribute "identifier" "name" "cylinder1"
TransformBegin
	Scale 0.5 0.5 0.5
	Surface "plaid" 
TransformEnd
#Translate  0.0 1.0 2.0
Translate  0.0 1.5 1.25
	TransformBegin
	Rotate 90 1 0 0
	Rotate -22.5 0 0 1
	Cylinder 3.8 0.0 4.0 225
	TransformEnd
AttributeEnd


# A floor
AttributeBegin
Attribute "identifier" "name" "floor"
Declare "w1" "float"
Declare "w2" "float"
Declare "w3" "float"
Declare "w4" "float"
Declare "col1" "color"
Declare "col2" "color"
Declare "col3" "color"
Surface "plaid" "w1" 0.5 "w2" 0.15 "w3" 0.05 "w4" 0.1 "col1" 0.2 0.05 0.0 "col2" 0.0 0.15 0.3 "col3" 1 1 1
Translate 0.0 -2.0 0.0
  TransformBegin
  Rotate 90 1 0 0
  Polygon "P" [3 3 0  -3 3 0  -3 -3 0  3 -3 0]
  TransformEnd
AttributeEnd


WorldEnd
FrameEnd