(*** download for full text ***)
DENTHOR, coder for ...
_____ _____ ____ __ __ ___ ___ ___ ___ __ _____
/ _ \ / ___> | _ \ | |_| | \ \/ / \ \/ / | | / _ \
| _ | \___ \ | __/ | _ | \ / > < | | | _ |
\_/ \_/ <_____/ |__| |__| |__| |__| /__/\__\ |__| \_/ \_/
The great South African Demo Team! Contact us for info/code exchange!
| W E L C O M E |
| To the VGA Trainer Program | |
| By | |
| DENTHOR of ASPHYXIA | | |
+-------------------------------+ | |
--==[ PART 1 ]==--
Hi there! This is Denthor of ASPHYXIA, AKA Grant Smith. This training
program is aimed at all those budding young demo coders out there. I am
assuming that the reader is fairly young, has a bit of basic Std. 6 math
under his belt, has done a bit of programming before, probably in BASIC,
and wants to learn how to write a demo all of his/her own.
This I what I am going to do. I am going to describe how certain routines
work, and even give you working source code on how you do it. The source
code will assume that you have a VGA card that can handle the
320x200x256 mode. I will also assume that you have Turbo Pascal 6.0 or
above (this is because some of the code will be in Assembly language,
and Turbo Pascal 6.0 makes this incredibly easy to use). By the end of
the first "run" of sections, you will be able to code some cool demo
stuff all by yourself. The info you need, I will provide to you, but it
will be you who decides on the most spectacular way to use it.
Why not download some of our demos and see what I'm trying to head you
I will be posting one part a week on the Mailbox BBS. I have the first
"run" of sections worked out, but if you want me to also do sections on
other areas of coding, leave a message to Grant Smith in private E-Mail,
or start a conversation here in this conference. I will do a bit of
moderating of a sort, and point out things that have been done wrong.
In this, the first part, I will show you how you are supposed to set up
your Pascal program, how to get into 320x200x256 graphics mode without a
BGI file, and various methods of putpixels and a clearscreen utility.
NOTE : I drop source code all through my explanations. You needn't try
to grab all of it from all over the place, at the end of each part I
add a little program that uses all the new routines that we have
learned. If you do not fully understand a section, leave me
private mail telling me what you don't understand or asking how I
got something etc, and I will try to make myself clearer. One
last thing : When you spot a mistake I have made in one of my
parts, leave me mail and I will correct it post-haste.
■ Clearing the screen to a specific color
■ Putting a pixel on the screen (two different methoods)
■ What is the Pallette?
■ How do I read in the pallette value of a color?
■ How do I set the pallette value of a color?
■ How do I stop the "fuzz" that appears on my screen when I change the
■ How do I black out the screen using the pallette?
■ How do I fade in a screen?
■ How do I fade out a screen?
■ In closing
■ Circle Algorithim
■ Line algorithms
■ In closing
■ What is a Virtual Screen and why do we need it?
■ Setting up a virtual screen
■ Putting a pixel to your virtual screen
■ How to "Flip" your virtual screen on to the true screen
■ What is scrolling?
■ What do we scroll?
■ How do we scroll from side to side?
■ How do we scroll up or down?
■ Why do I need a lookup table? What is it?
■ How do I generate a lookup table?
■ How do I use a lookup table?
■ Where else do I use lookup tables?
■ The Principals of Animation
■ Frames and Object Control
■ Restoring the Overwritten Background
■ The ASM Putpixel
■ The Flip Procedure
■ Defining a 3-D object
■ Rotating a point with matrixes
■ Drawing a 3D point to screen
■ Possible improvements
■ How to draw a polygon
■ Drawing a vertical line
■ What is Chain-4?
■ The size of the chain-4 screen
■ Layout of the chain-4 screen, and accessing it
■ Uses of Chain-4
■ The sample programs
■ What is a "Crossfade"?
■ How does a crossfade work?
■ Problems with crossfades
■ What is full screen scrolling?
■ The theory
■ Our code
■ Extra bits
■ What is a 3d starfield?
■ How do they work?
■ How do we code this?
■ What next?
■ What is glenzing?
■ Faster Polygons
■ What is fixed point?
■ How do plasmas work?
■ Clever fading
■ Rotating the pallette
■ What is scaling?
■ Okay, so how do we code it?
■ Pixel Morphing
■ Static screen effect
■ Loading a PCX bitmap file
■ File packing
■ Using the file packer
■ Assembler - the short version
■ Fire Routines
■ Face Sorting
■ Hidden Face Removal
■ Free Direction Texture Mapping
■ How to put it to screen
■ In closing
As you can see, texture mapping (this type at least) is quite easy, and
produces quite a good result. You will however notice a bit of distortion
if you bring the polygon too close. This can be fixed by a) Subdividing the
polygon, so the one is made up of four or more smaller polygons. Much
bigger, but works; b) Using more accurate fixed point; or c) Figuring out
perspective correct texture mapping, mapping along constant-z lines etc.
When people write me, they often refer to my "tutes". This stems back to
Mark Feldman calling them such in the PCGPE. I always though a "tute" was
something you did with your car to gain someones attention. I dunno, maybe
its an Australian thing ;-)
I have been coding almost exclusively in C/C++ for the past year or so.
Sorry guys, thats all they will pay me for ;) Anyway, the trainers will
continue to be in Pascal for ease of understanding by beginners, but if
someone (*ahem* Snowman) doesn't start converting them to C soon, I will do
it myself. He also corrected any mistakes I made while he was converting,
so I'd prefer he did it (sort of a proofreader after release...)
Send me presents! It's my birthday!
(*** download for full text ***)