author | Francesco Abbate <francesco.bbt@gmail.com> | 2011年08月09日 10:16:54 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2011年08月09日 10:16:54 +0200 |
commit | 7a1a1607cb6d186480fe662088b4e62be0a561f9 (patch) | |
tree | 1087e22eb97cd77a08bd4c4cbd719a3f95844050 /plot3d.lua | |
parent | 3371160ef86992eae3092d06676a4396e1666ebf (diff) | |
download | gsl-shell-7a1a1607cb6d186480fe662088b4e62be0a561f9.tar.gz |
-rw-r--r-- | plot3d.lua | 13 |
diff --git a/plot3d.lua b/plot3d.lua index 8d6317a2..8e8756b2 100644 --- a/plot3d.lua +++ b/plot3d.lua @@ -2,6 +2,9 @@ local Pre3d = require 'pre3d/pre3d' local ShapeUtils = require 'pre3d/pre3d_shape_utils' +local pi = math.pi +local rgb = graph.rgb + local function opt_gener(options, defaults) return function(name) local t = (options and options[name]) and options or defaults @@ -17,7 +20,7 @@ local function set_transform(ct, rx, ry, dz) ct:translate(0, 0, dz and -dz or -80) end -function render_shape(shape, plt, stroke) +local function render_shape(shape, plt, stroke) local renderer = Pre3d.Renderer(plt) renderer.draw_overdraw = true @@ -38,10 +41,10 @@ function render_shape(shape, plt, stroke) return renderer end -function plot3d(f, x1, y1, x2, y2, options) +function graph.plot3d(f, x1, y1, x2, y2, options) local opt = opt_gener(options, {title= 'Pre3d', gridx= 20, gridy= 20}) - local plt = plot(opt 'title') + local plt = graph.plot(opt 'title') local nx = opt 'gridx' local ny = opt 'gridy' @@ -53,10 +56,10 @@ function plot3d(f, x1, y1, x2, y2, options) return plt end -function surfplot(fs, u1, v1, u2, v2, options) +function graph.surfplot(fs, u1, v1, u2, v2, options) local opt = opt_gener(options, {title= 'Pre3d', gridu= 20, gridv= 20}) - local plt = plot(opt 'title') + local plt = graph.plot(opt 'title') local nu = opt 'gridu' local nv = opt 'gridv' |