raytracer-c/scenes/table.yml
2020-12-20 18:56:00 -05:00

243 lines
4.7 KiB
YAML

# ======================================================
# table.yml
#
# This file describes the scene illustrated at the start
# of chapter 12, "Cubes", in "The Ray Tracer Challenge"
#
# by Jamis Buck <jamis@jamisbuck.org>
# ======================================================
# ======================================================
# the camera
# ======================================================
- add: camera
width: 400
height: 200
field-of-view: 0.785
from: [8, 6, -8]
to: [0, 3, 0]
up: [0, 1, 0]
# ======================================================
# light sources
# ======================================================
- add: light
at: [0, 6.9, -5]
intensity: [1, 1, 0.9]
# ======================================================
# describe the elements of the scene
# ======================================================
# floor/ceiling
- add: cube
transform:
- [ translate, 0, 1, 0 ]
- [ scale, 20, 7, 20 ]
material:
pattern:
type: checkers
colors:
- [0, 0, 0]
- [0.25, 0.25, 0.25]
transform:
- [ scale, 0.07, 0.07, 0.07 ]
ambient: 0.25
diffuse: 0.7
specular: 0.9
shininess: 300
reflective: 0.1
# walls
- add: cube
transform:
- [ scale, 10, 10, 10 ]
material:
pattern:
type: checkers
colors:
- [ 0.4863, 0.3765, 0.2941 ]
- [ 0.3725, 0.2902, 0.2275 ]
transform:
- [ scale, 0.05, 20, 0.05 ]
ambient: 0.1
diffuse: 0.7
specular: 0.9
shininess: 300
reflective: 0.1
# table top
- add: cube
transform:
- [ scale, 3, 0.1, 2 ]
- [ translate, 0, 3.1, 0 ]
material:
pattern:
type: stripes
colors:
- [ 0.5529, 0.4235, 0.3255 ]
- [ 0.6588, 0.5098, 0.4000 ]
transform:
- [ rotate-y, 0.1 ]
- [ scale, 0.05, 0.05, 0.05 ]
ambient: 0.1
diffuse: 0.7
specular: 0.9
shininess: 300
reflective: 0.2
# leg #1
- add: cube
transform:
- [ scale, 0.1, 1.5, 0.1 ]
- [ translate, 2.7, 1.5, -1.7 ]
material:
color: [ 0.5529, 0.4235, 0.3255 ]
ambient: 0.2
diffuse: 0.7
# leg #2
- add: cube
transform:
- [ scale, 0.1, 1.5, 0.1 ]
- [ translate, 2.7, 1.5, 1.7 ]
material:
color: [ 0.5529, 0.4235, 0.3255 ]
ambient: 0.2
diffuse: 0.7
# leg #3
- add: cube
transform:
- [ scale, 0.1, 1.5, 0.1 ]
- [ translate, -2.7, 1.5, -1.7 ]
material:
color: [ 0.5529, 0.4235, 0.3255 ]
ambient: 0.2
diffuse: 0.7
# leg #4
- add: cube
transform:
- [ scale, 0.1, 1.5, 0.1 ]
- [ translate, -2.7, 1.5, 1.7 ]
material:
color: [ 0.5529, 0.4235, 0.3255 ]
ambient: 0.2
diffuse: 0.7
# glass cube
- add: cube
transform:
- [ scale, 0.25, 0.25, 0.25 ]
- [ rotate-y, 0.2 ]
- [ translate, 0, 3.45001, 0 ]
material:
shadow: false
color: [1, 1, 0.8]
ambient: 0
diffuse: 0.3
specular: 0.9
shininess: 300
reflective: 0.7
transparency: 0.7
refractive-index: 1.5
# little cube #1
- add: cube
transform:
- [ scale, 0.15, 0.15, 0.15 ]
- [ rotate-y, -0.4 ]
- [ translate, 1, 3.35, -0.9 ]
material:
color: [1, 0.5, 0.5]
reflective: 0.6
diffuse: 0.4
# little cube #2
- add: cube
transform:
- [ scale, 0.15, 0.07, 0.15 ]
- [ rotate-y, 0.4 ]
- [ translate, -1.5, 3.27, 0.3 ]
material:
color: [1, 1, 0.5]
# little cube #3
- add: cube
transform:
- [ scale, 0.2, 0.05, 0.05 ]
- [ rotate-y, 0.4 ]
- [ translate, 0, 3.25, 1 ]
material:
color: [0.5, 1, 0.5]
# little cube #4
- add: cube
transform:
- [ scale, 0.05, 0.2, 0.05 ]
- [ rotate-y, 0.8 ]
- [ translate, -0.6, 3.4, -1 ]
material:
color: [0.5, 0.5, 1]
# little cube #5
- add: cube
transform:
- [ scale, 0.05, 0.2, 0.05 ]
- [ rotate-y, 0.8 ]
- [ translate, 2, 3.4, 1 ]
material:
color: [0.5, 1, 1]
# frame #1
- add: cube
transform:
- [ scale, 0.05, 1, 1 ]
- [ translate, -10, 4, 1 ]
material:
color: [ 0.7098, 0.2471, 0.2196 ]
diffuse: 0.6
# frame #2
- add: cube
transform:
- [ scale, 0.05, 0.4, 0.4 ]
- [ translate, -10, 3.4, 2.7 ]
material:
color: [ 0.2667, 0.2706, 0.6902 ]
diffuse: 0.6
# frame #3
- add: cube
transform:
- [ scale, 0.05, 0.4, 0.4 ]
- [ translate, -10, 4.6, 2.7 ]
material:
color: [ 0.3098, 0.5961, 0.3098 ]
diffuse: 0.6
# mirror frame
- add: cube
transform:
- [ scale, 5, 1.5, 0.05 ]
- [ translate, -2, 3.5, 9.95 ]
material:
color: [ 0.3882, 0.2627, 0.1882 ]
diffuse: 0.7
# mirror
- add: cube
transform:
- [ scale, 4.8, 1.4, 0.06 ]
- [ translate, -2, 3.5, 9.95 ]
material:
color: [0, 0, 0]
diffuse: 0
ambient: 0
specular: 1
shininess: 300
reflective: 1