programmers resources
  http://www.intel-assembler.it/  (c)2017 intel-assembler.it   info@intel-assembler.it
 
Search :  
Lingua Italiana    English Language   
Index
 
just an empty assembly space
just an arrow Intel Platform
just an arrow Article & Guides
just an arrow Download Software


23/01/2009 Featured Article: How to remove Buzus Virus (permalink)




:::3095257:::
Bottone Scambio Directory Pubblicitaonline.it
Home Page | Articles & Guides | Download | Intel Platform | Contacts

Google
 


Bookmark and Share
Download 
Tell a friend



VGA Trainer Program

A course for graphic programming in Pascal/ASM

(by grant smith denthor of asphyxia)

A 21 part guide for learning VGA graphic programming using Pascal and Assembly languages. Although many examples are written in old Pascal it's very easy to understand the concepts behind the algorithms and translate in any language.
This article is online from 2711 days and has been seen 7920 times





(*** download for full text ***)


                          DENTHOR, coder for ...
        _____   _____   ____   __   __  ___  ___ ___  ___  __   _____
       /  _  \ /  ___> |  _ \ |  |_|  | \  \/  / \  \/  / |  | /  _  \
       |  _  | \___  \ |  __/ |   _   |  \    /   >    <  |  | |  _  |
       \_/ \_/ <_____/ |__|   |__| |__|   |__|   /__/\__\ |__| \_/ \_/
                       smith9@batis.bis.und.ac.za
    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 ]==--

■ Introduction

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
towards.

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
        pallette?
■  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
■  Optimisation
■  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?
■  Assembler
■  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!

Byeeeee.....
  - Denthor
      16-04-96

(*** download for full text ***)




Top
Download 
Tell a friend
Bookmark and Share



Similar Articles

2D/3D Rotation asm demos
Source code for 2D and 3D rotation
(by Ash [NLB/BD])

3D Rotating Cube Assembler source
An improved asm code for 3d graphics
(by Arno W. Brouwer)

3D Texture Mapping theory and asm code
a mid-length text about texture logic and coding
(by Sean Barrett)

4K 3D Asm Demo
4096 byte 3D assembler graphical demo
(by Jari Kyt÷joki)

Accessing 256 kB of memory on a standard VGA-card
How to access unchained memory using bitplanes
(by Vulture)

Basic Introduction to 3D Programming
A short doc about howto plot in 3D
(by Synergist)

ELYSiUM's VGA Graphics & Sound Blaster Coding
Beginner VGA Graphics & Sound Blaster Programming
(by ELYSiUM)

Linear Frame Buffer (LFB) Emulator
An LFB emulator for VESA with Asm source code
(by Alexei A. Frounze)

Math.inc: General 3D math functions
A library with many math functions for 3d graphics
(by John McCarthy)

Perspective Transforms
A two page document with the perspective formulas
(by Andre Yew)

REFRACTION 4k intro
Assembler graphic demo, 3D chessboard
(by G.O.D.)

Simple Horizontal Scroller
Asm code for scrolling text in vga
(by Carlos Hasan)

Star Field
3D Assembly star field
(by VLA)

SVGA PutPixel
Programming the SVGA card in asm and C
(by ABE)

The PC GAMES PROGRAMMERS ENCYCLOPEDIA 1.0
A collection of 85 asm programming documents
(by various)

Three Dimensional Rotations For Computer Graphics
A short document on 3D rotation
(by VLA)

Three Dimensional Shading In Computer Graphics
A brief intro on 3d shading theory
(by VLA)

VGA Programmers Master Reference Manual
Complete VGA programming manual
(by Andrew Scott)

VGOPHONG Phong lighting and specular highlights
Theory, practice of phong lightnin and shade model
(by TimJ/Vertigo)

X-Sharp 3-D animation package v22
3D ball demo with zoom, share and move
(by Michael Abrash)

Zed3D programming guide
A compact reference for 3d computer graphics
(by SÚbastien Loisel)

 Tags: 3d, vga


webmaster jes
writers rguru, tech-g, aiguru, drAx

site optimized for IE/Firefox/Chrome with 1024x768 resolution

Valid HTML 4.01 Transitional


ALL TRADEMARKS ® ARE PROPERTY OF LEGITTIMATE OWNERS.
© ALL RIGHTS RESERVED.

hosting&web - www.accademia3.it

grossocactus
find rguru on
http://www.twitter.com/sicurezza3/
... send an email ...
Your name

Destination email

Message

captcha! Code