Let us take a look at the way of generating the following:
The red sphere is defined as follows. It has center < -2.5, 2.5, 2.5 > and radius 1.5. Its phong value is 1, the maximum. In fact, all shapes in this scene have phong value 1.
sphere {
< -2.5, 2.5, 2.5, > 1.5
pigment {
color Red
}
finish {
phong 1
}
}
The smaller yellow sphere is defined as follows. Its center is < 2, 1, -1 >
and radius 0.6.
sphere {
< 2, 1, -1 >, 0.6
pigment {
color Yellow
}
finish {
phong 1
}
}
The blue sphere has its center the origin and radius 1.
sphere {
0*x, 1
pigment {
color Blue
}
finish {
phong 1
}
}
The upper-right pink sphere has center < 3, 5, 9 > and radius 2.5.
It is a little farther away from the origin.
sphere {
< 3, 5, 9 >, 2.5
pigment {
color Pink
}
finish {
phong 1
}
}
The small yellow box is defined by two points, < -4, -1.5, 0.5 > and
< -2, -0.5, 1.5 >.
box {
< -4, -1.5, 0.5 >, < -2, -0.5, 1.5 >
pigment {
color Yellow
}
finish {
phong 1
}
}
The large magenta box is defined by < 2.5, -2, -4 > and < 4, -1, 4 >.
box {
< 2.5, -2, -4 >, < 4, -1, 4 >
pigment {
color Magenta
}
finish {
phong 1
}
}
The floor is a plane. Its normal vector is y, pointing upward, and
the distance from the origin to the plane is -2. Therefore, this plane is
beneath all shapes; but, none of the shapes lies on the plane (shapes are
"floating" in space):
plane {
y, -2
pigment {
color Cyan
}
finish {
phong 1
}
}
We only use a single light source, which is above all shapes. Hence,
shadows are directly below the shapes. You might want to change the position
of this light source for further experiment.
light_source {
< 0, 10, -3 >
color White
}
Finally, where is our camera? Its location is < 0, 1, -8 >, which is
in the negative direction of the z-axis and above the
xy-coordinate plane. This position can be changed to cut off some
unwanted area (brining the shapes closer to your eyes). The viewing
direction is the positive direction of z-axis. up and
right are standard. Note that the length of direction
is 1, which sometimes looks like a moderate wide-angle lens. An experiment
worthwhile to do is moving location further back and increasing
the length of direction.
camera {
location < 0, 1, -8 >
direction z
up y
right 4/3*x
}
Note that since there is no background specified, those open space will have the default background color (i.e., black).
If you take a look at the read and pink spheres, their bottom parts seem disappearing in the dark. The blue and yellow spheres look a little better; but, they still look strange. Usually, adding some ambient would improve the situation. The following scene is exactly identical to the above one, except that all spheres now carry ambient values of 0.2: