From 9871e9aa62cf10c0f0cba712a499ff05cd4c6e66 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 22 Mar 2005 23:04:31 +0000 Subject: [PATCH] polish --- demos/anim.script | 15 +++++---------- demos/rotate.script | 25 +++++++++---------------- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/demos/anim.script b/demos/anim.script index b4bfba23c4..8949380e34 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 4495ea355f..d911e3bafa 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; -- GitLab