Behind the Technology of Marblebook

Take the Tour Back to Math21a course website.

All textures were rendered with the following Povray code. Povray is a raytracer. In our case, we have a simple sphere of radius 1 with the texture file. There is a camera and a light source. The map_type 1 gives us a spherical parametrization
r(u,v) = (cos(u) sin(v), sin(u) sin(v), cos(v) )
where u is the theta angle and v is the phi angle. The picture is scaled with this map so that the u goes from 0 to 2pi and v goves from 0 to pi. The "clock" variable is used when animating the scene. It is successively increased from 0 to 1 while rendering frames. The actual ray tracing uses a clever idea: instead of starting photons at the light source, the program shoots photons from the camera into the scene, bounces it at all the object. If it reaches the light source, the material properties determine the color one "sees" in this direction.

File "marble.pov":
camera       { location <0,1,-3> right x up y look_at <0,0,0> }
background   { rgb <1,1,1> }
light_source { <0,10,0> color rgb <1,1,1> }
#declare A = sphere {0, 1
  pigment {image_map {png "texture.png" map_type 1 interpolate 4}}
  finish  {phong 0.5 ambient 0.5 diffuse 1.0}
#object { A rotate y*360*clock}
File "anim.ini"
Initial_Frame = 0
Final_Frame   = 36
In Linux, we rendered all the frames and make a movie: with
povray anim.ini marble.pov
for i in *.ppm; do convert $i `basename $i ppm`gif; done
gifmerge -l0 -10 *.gif > movie.gif
For virtually all animation for movies is done using Linux render frams. In our case, with rendering only one sphere, this can be done by a single ordinary desktop machine. All was scripted to deal with all the picture submissions. The rendering for the entire class was done unattended and took a few hours during the night.

Mapping on a cylinder, we just have to replace the quadric:
quadric {<1,0,1>, <0,0,0>, <0,0,0>, -1}
When mapping on an ellipsoid we take the quadric:
quadric {<0.5,1,1>, <0,0,0>, <0,0,0>, -2}
When mapping on a hyperboloid we just have to replace the quadric:
quadric {<1,-1,1>, <0,0,0>, <0,0,0>, -1}
Mapping on a box
box     {<-1,-1,-1>, <1,1,1>}

Back to the course website