diff --git a/demos/anim.script b/demos/anim.script index b4bfba23c451ca24eec4680795e40f36506208e4..8949380e34767812c8b8a960369c9f27cc21a49e 100644 --- a/demos/anim.script +++ b/demos/anim.script @@ -1,16 +1,11 @@ // This script creates an mpeg or gif animation by looping over all // the time steps and/or all the post-processing views -all = GetValue("Animate one view at a time or all views together? - -0: one at a time, 1: all together", 1) ; - -oldw = General.GraphicsWidth; neww = GetValue("Width of animation? (enter 0 to keep current width)", 640); - -oldh = General.GraphicsHeight; newh = GetValue("Height of animation? (enter 0 to keep current height)", 640) ; +all = GetValue("Animate one view at a time or all views together? +0: one at a time, 1: all together", 1) ; method = GetValue("Animation encoder? 0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0) ; @@ -18,6 +13,9 @@ MPEG_ENCODE = 0; MENCODER = 1; WHIRLGIF = 2; +oldw = General.GraphicsWidth; +oldh = General.GraphicsHeight; + If(neww) General.GraphicsWidth = neww; EndIf @@ -25,8 +23,6 @@ If(newh) General.GraphicsHeight = newh; EndIf -Print.JpegQuality = 100; - If(all) maxstep = 1; For i In {1:PostProcessing.NbViews} @@ -78,7 +74,6 @@ If(!all) EndFor EndIf - NUM_FRAMES = index; ENCODER = method; Include "encode.script"; diff --git a/demos/rotate.script b/demos/rotate.script index 4495ea355f765a7e6d838b29e3dac0b5f73980f8..d911e3bafa1d9e5209adec8d82adfc3c4bbb9dae 100644 --- a/demos/rotate.script +++ b/demos/rotate.script @@ -1,12 +1,12 @@ // This script creates an mpeg or gif animation by applying // incremental rotations around the 3 coordinate axes -oldw = General.GraphicsWidth; neww = GetValue("Width of animation? (enter 0 to keep current width)", 640); - -oldh = General.GraphicsHeight; newh = GetValue("Height of animation? (enter 0 to keep current height)", 640); - +steps = GetValue("Number of steps", 360); +xinc = GetValue("X-axis rotation increment (in degrees)", 0); +yinc = GetValue("Y-axis rotation increment (in degrees)", 1); +zinc = GetValue("Z-axis rotation increment (in degrees)", 0); method = GetValue("Animation encoder? 0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0); @@ -14,11 +14,11 @@ MPEG_ENCODE = 0; MENCODER = 1; WHIRLGIF = 2; -steps = GetValue("Number of steps", 360); -xinc = GetValue("X-axis rotation increment (in degrees)", 0); -yinc = GetValue("Y-axis rotation increment (in degrees)", 1); -zinc = GetValue("Z-axis rotation increment (in degrees)", 0); +oldr = General.Trackball; +oldw = General.GraphicsWidth; +oldh = General.GraphicsHeight; +General.Trackball = 0; If(neww) General.GraphicsWidth = neww; EndIf @@ -26,19 +26,11 @@ If(newh) General.GraphicsHeight = newh; EndIf -Print.JpegQuality = 100; -General.Trackball = 0; - -General.Light0X = 1; -General.Light0Y = 0; -General.Light0Z = 0; - index = 0; For (1:steps) General.RotationX += xinc; General.RotationY += yinc; General.RotationZ += zinc; - index++; Draw; If(method == WHIRLGIF) @@ -53,5 +45,6 @@ NUM_FRAMES = index; ENCODER = method; Include "encode.script"; +General.Trackball = oldr; General.GraphicsWidth = oldw; General.GraphicsHeight = oldh;