Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9871e9aa
Commit
9871e9aa
authored
20 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
polish
parent
b7c54dc3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
demos/anim.script
+5
-10
5 additions, 10 deletions
demos/anim.script
demos/rotate.script
+9
-16
9 additions, 16 deletions
demos/rotate.script
with
14 additions
and
26 deletions
demos/anim.script
+
5
−
10
View file @
9871e9aa
// This script creates an mpeg or gif animation by looping over all
// This script creates an mpeg or gif animation by looping over all
// the time steps and/or all the post-processing views
// 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);
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) ;
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?
method = GetValue("Animation encoder?
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0) ;
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0) ;
...
@@ -18,6 +13,9 @@ MPEG_ENCODE = 0;
...
@@ -18,6 +13,9 @@ MPEG_ENCODE = 0;
MENCODER = 1;
MENCODER = 1;
WHIRLGIF = 2;
WHIRLGIF = 2;
oldw = General.GraphicsWidth;
oldh = General.GraphicsHeight;
If(neww)
If(neww)
General.GraphicsWidth = neww;
General.GraphicsWidth = neww;
EndIf
EndIf
...
@@ -25,8 +23,6 @@ If(newh)
...
@@ -25,8 +23,6 @@ If(newh)
General.GraphicsHeight = newh;
General.GraphicsHeight = newh;
EndIf
EndIf
Print.JpegQuality = 100;
If(all)
If(all)
maxstep = 1;
maxstep = 1;
For i In {1:PostProcessing.NbViews}
For i In {1:PostProcessing.NbViews}
...
@@ -78,7 +74,6 @@ If(!all)
...
@@ -78,7 +74,6 @@ If(!all)
EndFor
EndFor
EndIf
EndIf
NUM_FRAMES = index;
NUM_FRAMES = index;
ENCODER = method;
ENCODER = method;
Include "encode.script";
Include "encode.script";
...
...
This diff is collapsed.
Click to expand it.
demos/rotate.script
+
9
−
16
View file @
9871e9aa
// This script creates an mpeg or gif animation by applying
// This script creates an mpeg or gif animation by applying
// incremental rotations around the 3 coordinate axes
// incremental rotations around the 3 coordinate axes
oldw = General.GraphicsWidth;
neww = GetValue("Width of animation? (enter 0 to keep current width)", 640);
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);
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?
method = GetValue("Animation encoder?
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0);
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0);
...
@@ -14,11 +14,11 @@ MPEG_ENCODE = 0;
...
@@ -14,11 +14,11 @@ MPEG_ENCODE = 0;
MENCODER = 1;
MENCODER = 1;
WHIRLGIF = 2;
WHIRLGIF = 2;
steps = GetValue("Number of steps", 360);
oldr = General.Trackball;
xinc = GetValue("X-axis rotation increment (in degrees)", 0);
oldw = General.GraphicsWidth;
yinc = GetValue("Y-axis rotation increment (in degrees)", 1);
oldh = General.GraphicsHeight;
zinc = GetValue("Z-axis rotation increment (in degrees)", 0);
General.Trackball = 0;
If(neww)
If(neww)
General.GraphicsWidth = neww;
General.GraphicsWidth = neww;
EndIf
EndIf
...
@@ -26,19 +26,11 @@ If(newh)
...
@@ -26,19 +26,11 @@ If(newh)
General.GraphicsHeight = newh;
General.GraphicsHeight = newh;
EndIf
EndIf
Print.JpegQuality = 100;
General.Trackball = 0;
General.Light0X = 1;
General.Light0Y = 0;
General.Light0Z = 0;
index = 0;
index = 0;
For (1:steps)
For (1:steps)
General.RotationX += xinc;
General.RotationX += xinc;
General.RotationY += yinc;
General.RotationY += yinc;
General.RotationZ += zinc;
General.RotationZ += zinc;
index++;
index++;
Draw;
Draw;
If(method == WHIRLGIF)
If(method == WHIRLGIF)
...
@@ -53,5 +45,6 @@ NUM_FRAMES = index;
...
@@ -53,5 +45,6 @@ NUM_FRAMES = index;
ENCODER = method;
ENCODER = method;
Include "encode.script";
Include "encode.script";
General.Trackball = oldr;
General.GraphicsWidth = oldw;
General.GraphicsWidth = oldw;
General.GraphicsHeight = oldh;
General.GraphicsHeight = oldh;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment