Author : Grant Smith
Page : << Previous 17 Next >>
feeling that something more is required. "Either that
or I want to be a fireman."
]
- Grant Smith
14:32
21/11/93
See you next time,
- DENTHOR
[Note: things in brackets have been added by Snowman. The original text
has remained mostly unaltered except for the inclusion of C++ material]
Introduction
Hello everybody! Christmas is over, the last of the chocolates have been
eaten, so it's time to get on with this, the eighth part of the ASPHYXIA
Demo Trainer Series. This particular part is primarily about 3-D, but
also includes a bit on optimisation.
If you are already a 3-D guru, you may as well skip this text file, have
a quick look at the sample program then go back to sleep, because I am
going to explain in minute detail exactly how the routines work ;)
If you would like to contact me, or the team, there are many ways you
can do it : 1) Write a message to Grant Smith/Denthor/Asphyxia in private mail
on the ASPHYXIA BBS.
2) Write a message in the Programming conference on the
For Your Eyes Only BBS (of which I am the Moderator )
This is preferred if you have a general programming query
or problem others would benefit from.
4) Write to Denthor, EzE or Goth on Connectix.
5) Write to : Grant Smith
P.O.Box 270 Kloof
3640
Natal
6) Call me (Grant Smith) at (031) 73 2129 (leave a message if you
call during varsity)
7) Write to mcphail@beastie.cs.und.ac.za on InterNet, and
mention the word Denthor near the top of the letter.
NB : If you are a representative of a company or BBS, and want ASPHYXIA
to do you a demo, leave mail to me; we can discuss it.
NNB : If you have done/attempted a demo, SEND IT TO ME! We are feeling
quite lonely and want to meet/help out/exchange code with other demo
groups. What do you have to lose? Leave a message here and we can work
out how to transfer it. We really want to hear from you!
Optimisation
Before I begin with the note on 3-D, I would like to stress that many of
these routines, and probably most of your own, could be sped up quite a
bit with a little optimisation. One must realise, however, that you must
take a look at WHAT to optimise ... converting a routine that is only
called once at startup into a tightly coded assembler routine may show
off your merits as a coder, but does absolutely nothing to speed up your
program. Something that is called often per frame is something that
needs to be as fast as possible. For some, a much used procedure is the
PutPixel procedure. Here is the putpixel procedure I gave you last week:
[Note: Snowman here! I consulted the official Intel documentation and
noticed that Denthor is basing the clock ticks on the 8088 processor and
not the 286, 386, or 486 processors. I have taken the time to include
the information for these other processors.]
Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);
BEGIN -clock ticks-
Asm 8088 286 386 486
push ds 14 3 2 3
push es 14 3 2 3
mov ax,[where] 8 5 4 1
mov es,ax 2 2 2 3
mov bx,[X] 8 5 4 1
mov dx,[Y] 8 5 4 1
push bx 15 3 2 1
mov bx, dx 2 2 2 1
mov dh, dl 2 2 2 1
xor dl, dl 3 2 2 1
shl bx, 1
Page : << Previous 17 Next >>