Title: Using AVSExpress in an Introductory Computer Graphics Course
1Using AVS/Express in an Introductory Computer
Graphics Course
2Course Structure
- Undergraduate course is a modular scheme
- Students study 8 modules per year, each one for
15 weeks, for 3 years - Second year Tools for Graphics and Visualisation
- Third year Methods for Graphics and Visualisation
3Tools for Graphics and Visualisation
- Uses 2D images to implement some of the standard
algorithms in computer graphics-
- draw a circle
- rotate, scale, and translate a 2D shape
- window to viewport transformation
- calculate co-ordinates of intersection of 2 lines
- zoom in and out, pan up/down/left/right
- Bezier Curve drawing to fit 4 points
4Visualisation component
- Create 3D shape from either -
- 2D profile
- surface co-ordinates
- Use AVS/Express to visualise the 3D shape
- Use AVS/Express to animate the 3D shape
5Draw a Circle
- The co-ordinates of any point on the edge of a
circle centred at the origin may be obtained from
the following equations -
- X Radiuscosine(?)
- Y Radiussine(?)
- where ? is the angle in radians between the X
axis and a point on the circle (in an
anti-clockwise direction)
6Draw a Circle
Y-axis
- ? degrees?/180
- X Radiuscosine(?)
- Y Radiussine(?)
Radius
?
X-axis
7Create 3D solid from 2D profile
Y
Y
Solid of revolution of bottle shape
Z
Profile
X
X
8Create 3d solid from 2D profile
- The students use the circle code to generate
the X and Z co-ordinates (the Y
co-ordinates remain constant for each point on
the profile)
- They also have to generate an extra set of
co-ordinates (exactly the same as the first set)
to make AVS/Express join the last point up to the
first one.
9Surface Plot
- Specify a regular grid for the (x,y,z)
co-ordinates
- Student has to generate a height for each
co-ordinate based on a random number
103D Surface
- Create a new mid-way point
- Make its height the average of the adjacent points
- Randomly modify its new height within limits
a
b
c
11Include the diagonals
- Also along the diagonals based on the heights of
the four corners (a, b, c, and d)
a
b
c
d
12(No Transcript)
13Field file for a bottle
- AVS field file
- bottle
- ndim 2
- dim1 21
- dim2 15
- nspace 3
- veclen 1
- data integer
- field irregular
14Field file for bottle (continued)
- coord 1 filebottle.dat filetypeascii skip0
offset0 stride4 - coord 2 filebottle.dat filetypeascii skip0
offset1 stride4 - coord 3 filebottle.dat filetypeascii skip0
offset2 stride4 - variable 1 filebottle.dat filetypeascii skip0
offset3 stride4
15(No Transcript)
16Bottle
3D axis with text title
17Crop
Used crop to reduce the number of horizontal
steps drawn
18Crop
Used crop to reduce the number of vertical points
drawn
19Downsize
Used downsize to reduce the number of steps drawn
around the circle
20Downsize
Used downsize to reduce the number of profile
points drawn
21(No Transcript)
22Field file for 3D solid example
- AVS field file
- ndim 2
- dim1 9
- dim2 11
- nspace 3
- veclen 1
- data integer
- field irregular
23Field file (continued)
- coord 1 filexmastree.dat filetype ascii Skip0
offset0 stride4 - coord 2 filexmastree.dat filetype ascii Skip0
offset1 stride4 - coord 3 filexmastree.dat filetype ascii Skip0
offset2 stride4 - variable 1 filexmastree.dat filetypeascii
Skip0 offset3 stride4
24(No Transcript)
25Neither downsize nor crop used on the first image
26Downsize
Used downsize to reduce the number of steps in
each circle
27Downsize
Used downsize to reduce the number of profile
points
28Crop
Used crop to reduce the number of horizontal
steps drawn
29- Here is a selection of some
- other shapes created
- by the students
30Brolly
31Rings
32Speaker
33Cross section of a speaker
34Two stroke cylinder
35Animation using AVS/Express
- Once an image has been created, the students can
animate the image using the keyframe method of
animation
- This creates a series of views (keyframes)
- AVS/Express can save images from a view
- Then add frames between the keyframes to produce
the animated sequence
36Key-frame animation
- Need two images which depict the start and end
frames
- Create an animation sequence by adding frames
between the two images - The two images must have a reasonable level of
coherence
37AVS/Express
- AVS/Express interpolates images between a series
of captured visualisations
- Student captures the keyframes
- Assigns each keyframe to a time step
- AVS/Express automatically adds the required
number of frames between these keyframes to
produce an animated sequence
38Keyframes and interpolated frames
keyframes the user defines
interpolated frames added by AVS/Express
39AVS animation features
- Simple to add/delete/move keyframes
- If not a regular time interval between keyframes,
then specify the time of next frame before adding
it - Can create a cyclic animation
- Playback control offers forwards, backwards, and
bounce
40(No Transcript)
41Keyframe Controls
42Module Panel
Modules pull-down menu
Playback the animation
43Finally . . .
- This is how we teach visualisation in a level 2
module -
Use AVS/Express to animate the image
Use AVS/Express to visualise the data
Create 2D profile
Create 3D data
- What could we do in the level 3 module?