home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
413a.lha
/
C-Light_v1.06
/
README.DOC
< prev
next >
Wrap
Text File
|
1990-09-03
|
29KB
|
556 lines
===================================================
= =
= C-LIGHT =
= =
= Copyright © 1987,1988 by Ronald A. Peterson =
= All Rights Reserved. =
===================================================
The copy of C-Light contained on this disk is version 1.06
of a scene editor, ray tracing, and animation program. Please
see the file LEGAL.README which MUST accompany this program for
information about the author and redistributability. For those
not familiar with ray tracing, it is a technique whereby very
realistic three dimensional pictures of objects can be created
by tracing the paths of rays of light through a scene. The
unique features of C-Light include:
* Easy creation of animations in the ANIM standard format
* Stereoscopic 3D images that jump out of the screen using
X-Specs 3D glasses!
* Reflecting surfaces (mirrors).
* Shadows.
* Simple and quick scene creation using a powerful editor that lets you
visually place objects.
* Allows creation of scenes with up to 170 objects (spheres, cylinders
and cubes) each of which can be sized, rotated and located
independently in all three dimensions.
* Allows any number of light sources (up to object limit
of 170) with variable intensity and adjustable ambient light.
* Supports overscanned and interlaced-overscan images as well as
320 by 200 and 320 by 400 images, all in the standard IFF
format.
* Smoothly shaded objects with the color set selectable out of
4096 possible colors.
* Movable viewpoint (the observers eye.)
* Easy editing of scenes both during and after creation.
* Full Intuition interface for ease of use.
* Multitasking.
C-Light differs from other ray-tracers that have recently appeared
in that it is extremely simple to use. It requires no knowledge
of three dimensional geometry (except that which you were born with)
and presents the user with an interface similar to that found in the
better paint programs available today. In addition, C-Light can
easily produce smooth curved shapes such as spheres, ellipsoids,
and cylinders that are difficult to construct using polygon based
systems.
C-Light is made up of several parts or modules. The
C-LightI scene editor allows the user to create a three
dimensional scene using simple primitive objects (currently spheres,
cylinders, and cubes.) These objects can be interactively
placed, stretched, shrunk and rotated using a very friendly mouse
oriented interface. Imagine playing with rubber building blocks
that can be squeezed, squashed and stretched into many shapes.
The C-LightII ray tracer then takes this scene
description and calculates the resulting picture based on the
locations of the objects, light sources, and eyepoint. Both
overscanned and PAL (European) formats are supported, with or
without interlace. These pictures can then be saved to disk as
IFF picture files and viewed using the View utility which is
provided. Furthermore, a sequence of IFF pictures can be strung
together with the MakeANIM utility and then played back as an
animated movie with the PlayANIM program. All programs are
multitasking and will use fast RAM in place of chip memory where
possible.
CONTRIBUTIONS
This 1.06 version of C-Light is being made available as a freely
redistributable set of programs. After several years of trying to
market C-Light myself (and getting burned by a publisher and distributor)
I have come to the point where I currently don't have the time or
energy to devote to enhancing and marketing it. I have other projects
in which I am involved and other desires to pursue (though I may pick
C-Light up again in the future.) The history of C-Light makes for
an interesting tale in American entrepreneurship, but I've told it
many times so I'll spare you it here.
I am always interested in listening to offers for contract work
(on the Amiga or other graphics engines---Iris workstations, other
unix machines, ...) especiallly if there's a chance of royalties involved.
I'm particularly interested in working at home and on projects that are
artistically oriented or otherwise exciting (I wish I'd written Mandala
and I think I could spend much of the rest of my life in a Virtual Reality!)
Scientific programming also perks the interest of the physicist in me
and I'm conversant in several forms of electronics. Contact me at
the address below if you want to talk about your project needs and
my capabilities.
I've written an enhanced version of C-Light that can handle a
greater number of objects, process image files in batch mode and which
adds a cone type object, but it is still a little buggy so I'm releasing
the 1.06 version instead. If you'd like to see further versions of
C-Light you can aid me in creating them by sending a contribution.
This will net you the following benefits:
A. All contributions will be used for program development and maintenance.
B. Any user who sends a contribution to Peterson Enterprises will be added
to a list of registered users. (Currently over 1000 copies of C-Light
have been distributed world-wide.) This list will be used to distribute
enhancements, bug fixes and announcements of future software.
C. C-Light may be obtained from Peterson Enterprises for a contribution
of $25.00 in North America (please increase accordingly for over-seas
orders.) This will register you as a user and provide you with the
following items:
* A 100 page, spiral bound, users manual complete with instructions for
getting started, a tutorial, a reference section, and tips and tricks
for using C-Light.
* Two disks containing the entire C-Light raytracing/animation system as
well as:
- Example image files of objects
- Demo pictures
- Demo animations
- Demo stereoscopic picture
- C source code for creating image files from your own programs
- Online Documentation
* Information on future enhancements/releases of C-Light.
If you just want to add your name to the distribution list to insure
continued maintainence, send a (suggested) contribution of $15.00.
Send contributions to:
Peterson Enterprises
7 Grove Street
Haydenville, MA
01039 USA
Your comments and suggestions about C-Light, possible enhancements,
bug reports, and related products are welcome! Please contact
Peterson Enterprises at the address given above or at one of the
following electronic addresses:
ron@vicorp.COM
rpeterson on BIX
ops448 on PeopleLink
Formalities aside, here is a brief description of how to use C-Light :
It is necessary to use V1.2 of Workbench with C-Light and a
Preferences setting for eighty column text is desirable. C-Light
is a complex program; if run on a 512K Amiga, it will require almost
all memory to be available. This means that you should have as few
windows as possible open and no other programs running. On an Amiga
with more than 512K RAM, C-Light will gracefully multitask with only
one side effect---calculating an interlaced picture will cause all
screens to be interlaced.
C-Light makes extensive use of Intuition (gadgets, sliders,
menus, etc.) which means many functions can be easily understood
just by trying the gadget or slider to see what it does. The
programs can be run from Workbench or from CLI. C-Light is in
two parts ( C-LightI and C-LightII ) and also includes two
utilities: Video and View.
*---VIDEO ---*
Calling up Video allows you to select screen resolution and
PAL or USA compatability by responding to requestors which ask
yes or no questions about your choices. (Note that Video has no
effect on pictures that have already been generated.)
*--- C-LightI ---*
C-LightI is the scene editor. Upon calling it up you will
see some gadgets on the right side of the screen and a title
bar. There is a drag-down menu attached to the left side of the
title bar. This is the utilities menu which contains the
following functions:
Hide Title Bar - Hides/restores the title bar.
Hide Selectors - Hides/restores the gadgets on the right.
New Directory - Change directory (drawer) or disk.
Colors - Lets you change the CURRENT screen colors,
not the colors used in the scene.
Reset All - For starting a new scene.
Load file - Load in a scene file.
Save file - Save a scene file.
Exit - Go have a look in the fridge.
Most of these menu selections call up requestors. The use of these
requestors conforms to the rules outlined in the "Introduction to Amiga"
manual. Try loading in and playing with the example scene file
included which is entitled "EllipsoidMan" (which is sort of like
Schizoid Man for you King Crimson and Prisoner freaks.)
The function of the gadgets on the right side of the
screen will be covered next:
BALL, CUBE, CAN - When clicked on, these gadgets will cause an
outline (wireframe image for the technical among you) of the
corresponding object to appear. Using the mouse you can move the
object left/right or up/down. By clicking the right mouse button
(when the cursor is NOT over the title bar) the object can be
moved in/out in depth with the mouse instead of up/down.
Clicking the right button again will restore up/down movement.
Because the space in which you are moving the object is much
larger than the screen of the Amiga, the object does not follow
the cursor position. For example, if the object is in the center
of the screen and the cursor is on the right edge of the screen,
you can keep moving the mouse to the right (picking it up and
moving it, picking it up and moving it, ...) and even though the
cursor doesn't move, the object will keep moving to the right
eventually going off the screen. A mouse is inherently a device
for manipulating two dimensional objects so this is how I turn it
into a 3D manipulator. You can think of the object being moved
as a new, three dimensional cursor for the mouse if you like.
As you are moving the object around you will see the X, Y, Z
coordinates of the CENTER of the object being displayed in screen
coordinates. Once you have the object somewhere near where you
want it, click the left mouse button and the Object Modification
Requestor will appear. (Fancy name eh? I thought that one up
myself.) The sliders on this requestor let you change the size
of the object in the X, Y and Z directions and allow you to
rotate the object around the X, Y and Z axis. As long as you hold
the knob of the slider away from the center, the size or rotation
of the object will change. The further from center it is moved
the faster the change will be. The gadgets labeled A, B, C, M let
you pick the color for the object. I will discuss later how
to set these colors to whichever out of the 4096 possible colors
that you choose and how to set the background color for a scene.
The "M" gadget makes the object have a mirror (almost perfectly
reflecting) surface.
Hit the CANCEL gadget if you decide you don't want the
object. The requestor can be moved by dragging it via its
title bar. You can still move the object around when the object
modification requestor is present by clicking with the left mouse
button anywhere outside the requestor. The requestor becomes
inactive and you can then move the object around using the mouse,
just as you did before the requestor appeared. Clicking the left
button again activates the requestor again and stops the object
from moving when you move the mouse. In this way you can
alternate between moving the object and sizing or rotating it
until you have it exactly as you want it. Then, hit the close
gadget in the upper left corner of the requestor and the
requestor will disappear and the object will change color
indicating that it has been set in place.
DEL, CHG - Once you have placed an object you can still change
it. Hit the DELete gadget and then click on the CENTER of the
object you want to delete with the left mouse button. The object
will be highlighted in a different color and a requestor will ask
if this is the object you really want to delete.
The CHG gadget works in a similar fashion. Hit CHG, then
click on the object you want to change. It will be highlighted
in a different color and the object modification requestor will
appear. From then on you can treat everything just as though you
were placing the object for the first time.
VIEW - Once you have defined a scene you can use this gadget to
move, rotate, stretch or shrink the scene as a whole. Click on
it and you will see the scene disappear, then a cube and the
object modification requestor take its place. Imagine your scene
is inside this cube. You can then rotate it, move it, and size
it. Hitting the close gadget on the requestor will cause the
scene to be redrawn using the new view. This is also useful for
rotating a scene to get at and change the parts of it that are in
back of other objects.
EYE - This allows you to set how close or far the observers eye
is from the scene. It uses the object modification requestor
again and works just like moving your own eye nearer or further
from a window (the screen of your monitor being the window.) As
you move closer to the window you can see more of the scene. It
also becomes more distorted by perspective (an effect like a fish
eye lense on a camera.) As you move further away you can see
less of the scene through the window and things become less
distorted and more natural looking. Currently the eye point can
only be moved closer or further away; I may add up/down and
left/right movement to it if it seems useful. Clicking on the
close gadget will cause the scene to be redrawn using the new
eyepoint.
COLR - This gadget calls up a requestor that allows you to change
the color of the OBJECTS. It does not affect the current colors
used on the screen. This is where the colors A, B, C and the
background color are determined. The colors you pick for A, B,
and C are the colors that will be used in your object at its
brightest spots. The brightest spots will be those closest to
the light sources. The rest of the object will be in blacker
shades of this color, getting dimmer the further that part of the
object is from the light. (Just like in real life!)
LITE - This gadget allows you to place light sources in your
scene. A light is treated just like an object (BALL, CUBE, CAN)
and is placed in the same way. Sizing and rotation of light
sources has no effect on the picture. Lights are point sources
that radiate in all directions. The only limit on the number of
light sources is the limit on the total number of objects (170 for
this version, but then there would be no room for objects.)
More lights means a longer calculation time though.
*--- C-LightII ---*
Once you have created a scene and saved it to disk, the
second part of the program comes into play - C-LightII .
C-LightII is the part that actually draws the scene. Ray tracing
is a complex mathematical process so this can take some time -
from a half hour up to several days. When you call up C-LightII
you will see a requestor. Hitting "Get File" calls up a
directory requestor that allows you to select the scene you want
to calculate. After picking a scene you can set some of the
overall characteristics of the scene with the sliders and
gadgets:
LIGHT slider - This sets the intensity of all the lights in a
scene. The number displayed near the slider is the range at
which the lights will be at half intensity.
AMBIENT slider - This sets the background level of light that
illuminates ALL objects equally.
BLEND slider - This one controls how much blending together of
colors occurs. Given ten shades of each color with which to shade
an object, randomly blending them a little makes the picture
look smoother. Too much and your picture will be lost in fuzz.
Too little and you will see bands of color.
ALIAS gadget - Turning this on enables anti-aliasing. This is a
simple algorithm that tries to lessen the effects of jagged edges
(caused by the fact that the screen is made up of a limited
number of rectangular dots.) It doesn't always improve the picture.
SHADOW gadget - Turning this gadget on will cause shadows to be
calculated for the scene. Shadows are VERY time consuming and
can easily cause a complex picture to take days to calculate,
particularly if there are many light sources.
SAVE gadget - This allows you to name and save the created
picture as an IFF file. The save requestor will come up
automatically when the picture is done.
You can get back to the main requestor at any time (in order to
exit, change settings or save an unfinished picture) by clicking
once with the left mouse button anywhere in the lower three quarters
of the screen.
*--- VIEW ---*
Finally, the VIEW program is an IFF picture viewer that
allows you to look at the saved IFF picture files (overscanned
ones too!) To view a picture from Workbench you can either just
double-click on the pictures icon or click once on the
pictures icon while holding down the left Amiga and Shift keys
simultaneously, then double click on the View icon. From CLI you
can type: VIEW 'picture' where 'picture' is the name of the file
you want to see (without the '.ilbm' extension.) Click anywhere
in the upper left corner to end it.
=========================================================================
ANIMATION!!!!!!
Here are some excerpts from the manual on creating animations with C-Light:
Animations can be
created in any mode (low-res, non-interlaced, interlaced, overscanned.)
IFF pictures created with other programs can be included in an animation also.
Note that you can NOT mix modes within an animation. If the first frame is
low-res and non-interlaced then the rest of the frames must be low-res and
interlaced. Interlaced animations will have a tendency to be slower because
more of the screen has to be changed. Also, having two floppy disk drives is
almost essential (although a RAM disk can probably be used in place of a
second floppy drive.)
Creating an ANIM file
Once you have created all the individual frames for a movie, they have
to be put together in the proper order and saved in a single file. Also,
in order to fit as many as possible in the memory of your Amiga, the
pictures have to be compressed into a more compact format. The ANIM
format was devised to give us a standard way to compress movies into
a common format. It achieves the compression of a sequence of pictures
into a smaller space by storing only the differences between each frame
instead of the entire picture. The MakeAnim utility has been included as
a part of C-Light to automatically compress a sequence of pictures and
create an ANIM file from them.
To use MakeAnim there are two simple preparations you have to make.
First, you need a blank disk that has been given the name TMP. (See
the "Introduction to Amiga" manual for instructions on formating a blank
disk and relabeling it or see the example in section 4.) This disk will
be used as a temporary work space by MakeAnim. [To use MakeAnim with a
hard disk drive, use the ASSIGN command to make your Amiga think that
the TMP: disk is a subdirectory of your hard disk. For example:
ASSIGN TMP: dh0:WorkArea/Movies
The ASSIGN command must be issued from a CLI window. See section 5 below
for instructions on creating a CLI window.]
Second, you need to create a list that tells MakeAnim where to find all
the pictures that make up your movie. If you have a text editor you can use
it to create the list (make sure to save the file as text-only so that all
the text formating characters are not included.) If you don't have a
favorite text editor you can use the simple one that came with your Amiga.
It is called ED and must be run from a CLI window. If you are not familiar
with ED or running programs from the CLI, see section 5 below for an easy
step by step tutorial on using ED.
This list, which tells MakeAnim where to find all the pictures in your
movie, is called a script file. It has the following format:
DiskName:Movie_Name
Time DiskName:Frame_1_Name
Time DiskName:Frame_2_Name
Time DiskName:Frame_3_Name
Time DiskName:Frame_4_Name
Time DiskName:Frame_5_Name
etc...
The first line tells MakeAnim what the name of the final ANIM file will
be and where to put it. The disk name can also include the names of
drawers (subdirectories) such as:
Movies:Melt_Drawer/Melt1.ilbm
The next lines tell where the pictures are, what order they go in, and
how long each one should stay on the screen. Again, the disk name can
include drawers. The order of the pictures is the same as their order
in the script file (the first one will be shown first, the second one
second, etc.) The time entry is a number that tells how long each
picture should stay on the screen. This gives you complete control
over how fast things change in any part of your movie. The time is
in multiples of one sixtyth of a second (1/60 second). Thus an entry of
zero means to show the current frame as fast as possible, an entry of one
means wait 1/60 second before going to the next frame, an entry of 2 means
wait 2/60 second before going to the next frame, etc. So if you want the
movie to run at about the same speed as a movie projector (24 frames/second)
try a time value of three. The following is an example of a complete script
file:
Animate:Enterprise
0 WorkDisk_1:Enterprise/Enterprise1.ilbm
0 WorkDisk_1:Enterprise/Enterprise2.ilbm
0 WorkDisk_1:Enterprise/Enterprise3.ilbm
0 WorkDisk_1:Enterprise/Enterprise4.ilbm
0 WorkDisk_1:Enterprise/Enterprise5.ilbm
0 WorkDisk_1:Enterprise/Enterprise6.ilbm
0 WorkDisk_1:Enterprise/Enterprise7.ilbm
0 WorkDisk_1:Enterprise/Enterprise8.ilbm
0 WorkDisk_2:Enterprise9.ilbm
0 WorkDisk_2:Enterprise10.ilbm
0 WorkDisk_2:Enterprise11.ilbm
0 WorkDisk_2:Enterprise12.ilbm
0 WorkDisk_2:Enterprise13.ilbm
0 WorkDisk_2:Enterprise14.ilbm
0 WorkDisk_2:Enterprise15.ilbm
60 WorkDisk_2:Enterprise16.ilbm
Note that the pictures are located on two different disks in this
example (WorkDisk_1: amd WorkDisk_2:). Also, on WorkDisk_1: the pictures
are in a subdirectory (drawer) while on WorkDisk_2: they are in the main
level directory. It is a good idea to have the final ANIM file reside on
a different disk from those containing the pictures so that you don't run
out of space. The time values are all set to zero so that the movie will
run as fast as possible except for the last one which is set to 60. This
means that the movie will pause for one second on the last frame before
going back to the first frame. (There can be as many spaces as you like
between time and picture name, but there must be at least one!) All
these variations show the flexibility that is allowed in creating a script
file.
Once you have created the script file, run MakeAnim. If you run it
from Workbench it will ask you for the name of the script file (a disk name
and/or drawer name can be included too.) [If you want to run from CLI, just
run MakeAnim and it will give you instructions.] Once MakeAnim has the
script file name, the rest of the process is automatic. A window will
open that will tell what is currently going on in the process of compressing
and storing the pictures. At various points in the process you will be asked
to insert different disks so that MakeAnim can access them (first it will
look at all the pictures and write out some temporary files to the TMP disk,
then it will take one picture and all the TMP files and create the final ANIM
file on the output disk.) This process really requires two disk drives.
It is possible to do it with only one, but you'll wear your arm out swapping
disks. If you have a RAM expansion the RAM disk can be used as a second
drive. Just copy all the pictures to the RAM disk and use RAM: for the
disk name in the script file. Alternatively, you can use the ASSIGN
command to make your Amiga think the RAM disk is the TMP disk. Just
issue the command:
ASSIGN TMP: RAM:
from a CLI window. See section 5 below for instructions on opening a
CLI window.
Even with two disk drives you should be intelligent about which drive
you put a disk into. Try to place disks in a drive such that you never have
two disks being accessed from the same drive. For example, MakeAnim first
asks for a picture disk, then asks for the TMP disk. Don't put the TMP
disk in the same drive as the picture disk or you will have to constantly
swap them. Instead, place it in the second drive and everything will
procede smoothly. Similarly, don't put the TMP and the final output disk
in the same drive. You can stop the process at any time by typing
Control-C (hold down the CTRL key and the C key at the same time.)
The process is relatively quick; it usually takes only five to
twenty minutes to create the final ANIM file depending on the length
of the movie and the amount of motion that occurs within it.
Playback of Animation
The PlayAnim tool is used to show your movie after the ANIM file has
been created. There are two different ways to play it back from Workbench.
[To playback from CLI, just run PlayAnim and it will give you instructions.]
In the first method you simply double click on the icon for the animation
you have created. This requires that a copy of PlayAnim is in the main
window for the disk that contains the ANIM file (or you can change the
tool type for the movie to point to the disk that has PlayAnim on it.)
To use the second method, just double click on the PlayAnim icon. A
requestor will ask you for the location/name of the ANIM file you wish
to view.
Once the ANIM file has been read in by PlayAnim, the first frame of
the movie will appear. To start it playing, just click in the screen once
with the left mouse button. When you want the movie to stop, click again
with the left mouse button. This method is designed to give you the most
precise control of start and stop times when patching together several
movies into a longer movie on your video tape recorder.
More precise control of the number of times the movie repeats is
possible by running PlayAnim from CLI. Also, you may notice that the
movie flickers a little when shown on your Amiga monitor. This is because
interlace is automatically turned on by PlayAnim in order to get the best
quality when recording on a video tape recorder. The interlace feature
can optionally be turned off when PlayAnim is run from CLI. (Run
PlayAnim from CLI to get instructions on how to set these options.)
========================================================================
So... that should be enough to get you started. I have tried
to make this program as simple to use as possible, modeling it
after paint programs like DeluxePaint. In fact, because shading
is a tough thing to do with a mouse, C-Light makes a nice
addition to paint programs since it lets you easily create
backgrounds of shaded 3D objects.
Let me know of any bugs that you find and I will try to
correct them in the next release. Enhancements for a (possible)
future release include:
HAM color mode.
Ability to use additional memory to add more objects.
Batch processing of .img files.
More object primitives - Cones, Half spheres, Trapezoidal
patches.
Boolean subtraction of objects.
Specular reflections (glossy surfaces)
Animation editor - to make creating animations even easier.
If you want to see 'em happen, send money!
Amiga, Workbench and Intuition are trademarks of Commodore-Amiga,
Inc.
DeluxePaint is a trademark of Electronic Arts.
X-Specs 3D is a trademark of Haitex Resources, Inc.