]> Dogcows Code - chaz/rasterize/blobdiff - animate.lua
finishing fifth project
[chaz/rasterize] / animate.lua
index 616c717f4eb51ff396a343b5a2759ef90faf35d8..1e8daf7f5d0f34543cbda37adf40571420d0098a 100755 (executable)
@@ -9,8 +9,7 @@
 -- This program automates the process of creating simple fly-by animations.
 -- The rasters are saved in the `frames' directory, and if ffmpeg is
 -- installed, the frames will also be combined into a video file.  This script
--- must be called from the same directory where the rasterize program is.
--- The CACHE_GEOMETRY option is also recommended to improve performance.
+-- must be called from the same directory where the raytrace program is.
 
 -- Set the number of frames to be rendered for the animation.
 local frames = 360
@@ -18,8 +17,8 @@ local frames = 360
 -- Define the code to calculate where the camera is, in world coordinates.
 local eye = function(frame)
     -- just rotate around the center of the scene on the XZ plane
-    local center    = vec_new(0, 0.4, 0)
-    local distance  = 0.7
+    local center    = vec_new(0, -0.5, 0)
+    local distance  = 4
     local start     = math.pi
     local t = start + 2 * math.pi * frame / frames
     local v = vec_new(math.cos(t), 0, math.sin(t))
@@ -33,19 +32,15 @@ local look = function(frame)
 end
 
 -- Define the actual objects of the scene that will be rendered, in the
--- extended u3d format.
+-- extended urt format.
 local scene = [[
-l -14687.0 7986.0 8976.0 1.0 1.0 1.0
-g checker.obj
-c 1.0 0.6 0.6 0.6
-m checker.ppm
-r -1.57 1.0 0.0 0.0
-p 1.0 1.0 1.0 100.0
-g teapot.raw
-c 0.9 0.7 0.1 0.2
-p 1.0 1.0 1.0 60.0
-t 0.0 0.1 0.0
-s 0.004 0.004 0.004
+l 0.0 10.0 1.0 0.8 0.7 0.8
+p 0.0 -5.0 0.0 0.0 1.0 0.0 0.4 0.8 0.4
+s 0.0 0.0 0.0 1.25 1.0 0.0 0.0
+s -1.0 -1.0 0.0 1.0 0.0 1.0 0.0
+s 1.0 -1.0 0.0 1.0 0.0 0.0 1.0
+t -1.5 0.0 1.5 -1.0 1.0 0.0 -0.5 0.0 1.5 0.8 0.9 0.2
+t 1.5 0.0 1.5 1.0 1.0 0.0 0.5 0.0 1.5 0.2 0.9 0.8
 ]]
 
 -- Set the number of samples for supersampling.  If this is set to a value
@@ -55,7 +50,7 @@ s 0.004 0.004 0.004
 local supersample = 2
 
 -- Set the width and height of the viewport.
-local size = {w = 640, h = 480}
+local size = {w = 800, h = 600}
 
 -- Set the number of concurrent renderings (for multi-core machines).
 local jobs = 6
@@ -90,19 +85,19 @@ function render(i)
             h = h * supersample
         end
         local filename  = fmt("frames/anim%04d.bmp", i)
-        local command   = fmt("./rasterize -o %s >/dev/null", filename)
+        local command   = fmt("./raytrace -o %s >/dev/null", filename)
         local out = io.popen(command, "w")
         local e = eye(i)
         local l = look(i)
         write("\27[80D\27[2Kframe\t %4d / %d", i, frames)
         out:write(fmt([[
-U4
+U5
 %d %d
 %f %f %f
 %f %f %f
 0 1 0
-1.57 %f 0.1 1000
-1.0 1.0 1.0
+1.57 %f
+0.4 0.4 0.4
 %s
 X
 ]], w, h, e.x, e.y, e.z, l.x, l.y, l.z, size.w/size.h, scene))
This page took 0.021325 seconds and 4 git commands to generate.