** 2 page feature /1349 words **
** Side banner: VR graphics tutorial
Calling the shots
Movies need not run in one direction - Guillaume Tello and
Shiuming Lai explain...
An object can be presented as an image, or, even better, with
animation. The next best thing before a true real time 3D virtual
environment is a QuickTime VR/1 animation where the user, moving
the mouse, can determine their point of view from the pre-rendered
frames and examine every detail. This file format has become a
standard and can be viewed on Atari machines using the appropriate
software.
This tutorial will guide you step-by-step through the creation of
a VR/1 file (VR = Virtual Reality).
The tools
Apple Macintosh and PC owners have it easy because the VR format
is a component part of QuickTime. However Atarians can generate
them using M Player/M Player STe and Easy BAT to facilitate the
script editing.
To replay VR animations you have a choice between:
* M Player STe (68000 running ST low or ST high)
* M Player (68030 and 256, 32K or 65K colours)
* Aniplayer (68030)
Our VR example
Thanks go to Franck Hivonnait for his POV script, which is the
basis for the images we've used in this article, i.e. a wooden die
standing on a reflective surface. We've shot 36 images in total
around the die at three different levels:
* 12 images with the camera at ground level
* 12 images at half-height
* 12 images with the camera looking down on the die.
The user can view the die from any of the three heights vertically
and horizontally from 12 positions around the die.
The images are named from DE_001.TGA to DE_036.TGA and should be
located in the same folder. From DE_001 to DE_012 is the first
level, from DE_013 to DE_024 is the second and from DE_025 to
DE_036 the upper level. You can download an archive of these
images from the M Player web site at:
** BC **
http://perso.wanadoo.fr/gtello/die.zip
** /BC **
Figure 5 shows, using Frederic Bayle's DIAPO viewer, the first
four frames of each different level. You can already see, the
frame advancing of this animation takes place in a 2D array
(exclusively on either axis, no diagonals are allowed), which in
this case happens to correspond to vertical and horizontal
movement. There is no z-buffer in the frame index data structure
so each view has only one zoom factor.
Writing the script with Easy BAT
** On Reader Disk Logo banner here **
Launch Easy BAT, v1.03, skip the first box and in the second one
select TGA as the image type. The third box summarises the images'
statistics (figure 1). Click on Read from a file, go to the folder
where your TGA files are and type DE*.TGA as the file name.
Easy BAT extracts the dimensions and file size from every TGA
file. It then computes the largest file size and writes this into
the script so M Player can reserve appropriate frame buffer sizes.
In the fourth box select a number for the quality, higher numbers
equate to higher quality and, larger file size. Choose 5 for now,
then click on Output filename... and type DE.MOV for the animation
to be generated.
In the fifth box, shown in figure 2, type 50 for the time of one
frame (50/200 second produces 4 images per second) and forces
every image to be a key frame with 1 as the parameter, because the
non-linear nature of VR video sequences is not suitable for Delta
compression. In this case, you can arrive at a frame from four
possible directions (up, down, left or right). To avoid clipping
errors, each frame would need four encodings, losing the benefit
of compression. As VR/1 has no sound just click on Ok.
In the sixth box, we'll enter the names of the images (figure 3).
Click on Fileselector and select DE_001.TGA as the first image.
Click on Increment and type 35 times (yes, if DE_001 is
incremented 35 times, all the images are included up to DE_036
with a few clicks!). Confirm with Validate this set then click on
End - since there's only one set.
The seventh box (figure 4) offers to convert a basic animation
into a VR one which is exactly what we want. You indicate 12
columns (number of horizontal views per level), 3 lines (number of
levels), Start X=6 and Start Y=1 for the first image to be
displayed. The number of images per cell is 1 as every view is a
fixed image, not an animated view. Validate Horizontal loop to
turn around the die and last of all click on Turn into VR/1
The global repetition field must stay empty, save as DE.BAT then
quit. Easy BAT doesn't create the animation but it does generate a
small script file called DE.BAT which is used by M Player to do
the hard work. Incidentally, DE.BAT, is a text file which can be
viewed using any ASCII text editor.
Creating the animation
Launch M Player or M Player STe. If you're using the demo version,
everything works but is displayed in greyscale instead of colour -
which is reserved for registered users.
Load DE.BAT and you'll get the box as shown in figure 6 displaying
the characteristics of DE.BAT. Use the combination [Alternate] +
Go to generate DE.MOV. After a short while, the QuickTime movie is
ready to be used on the disk.
Viewing the animation
Don't quit M Player/STe yet, load DE.MOV. Selecting Go invokes a
specific dialog for VR animations and you can choose: movements
with the keyboard or with the mouse, displaying as a VR
(interactive) or as a basic animation (no interaction). Once this
is done our die appears on the screen.
Try moving around the object, you can accelerate by pressing
[Shift] on the keyboard or using the left mouse button.
The future
The VR/1 format is useful and also supports moving objects - each
view can be a little animation instead of a fixed image. This is
supported by M Player and M Player STe in input as well as in
output. There's a more powerful format called VR/2. In this format
you're in the centre of a place in which your eye moves with a
continuous deformation of the space due to the perspective. For
example, imagine you're in front of two vertical bars, when you
look up, their tops appear closer than their bottoms, when you
look in front of you, the bars appear parallel and when you look
down, their bottoms appear closer than their tops.
There are currently no editors to create VR/2 on Atari, although
both Aniplayer and M Player can display them. M Player even
generates a perspective effect that's impressive - if not totally
accurate.
The main obstacle is not assembling the file - M Player could do
it, but creating the images. This is more a problem of raytracing
and projection that remains to be in the future.
** Boxout **
QuickTime VR
Graphic environment synthesis demands enormous processing power to
create a believable level of realism. As graphics hardware becomes
more powerful the algorithms to generate even more realistic
environments always seem to remain one step ahead! Even today,
apart from funded research projects, computers are struggling to
execute these algorithms fast enough for practical real time
applications.
QuickTime VR stores image sets explicitly, rather than computing
them from an object data set, and what it loses in movement
freedom and storage efficiency it gains in image realism. The
upper limit is bound by display dimension and colour depth.
** /boxout **
** boxout **
Sources
** On Reader Disk banner **
Easy BAT is included on the Reader Disk.
Easy BAT, M-Player and the die images are included on the renegade
CD.
Easy BAT and the die images can be downloaded from:
** BC **
http://perso.wanadoo.fr/gtello/
** /BC **
Aniplayer:
** BC **
http://perso.wanadoo.fr/didierm/
** /BC **
Frederic Bayle's DIAPO viewer:
** BC **
http://perso.club-internet.fr/f_bayle/
**/BC **
** /boxout **
** Images and captions **
** VR_FIG_1.GIF **
Figure 1
** VR_FIG_2.GIF **
Figure 2
** VR_FIG_3.GIF **
Figure 3
** VR_FIG_4.GIF **
Figure 4
** VR_FIG_5.GIF **
Figure 5
** VR_FIG_6.GIF **
Figure 6