(C) Crite / Triumph
(I) Blade / Triumph
-----------------
As once bored, I decided to write
lighting effect, the bulk surface
smarter to say bump mapping. Of course many of these effects
have you seen in different demah, but my effect is more simple
and fit into a frame, more precisely about
40,000 cycles.
I have long thought by some light on the display screen and
the flu has prompted me, finally turned out an attribute
option:) As soon as a reservation that all lower contained
nothing more than just a bump mapping'a algorithm and is
designed to development of ideas novice coders.
So my method is
that you specify the volume
CPC as a set of plates
films with different angle of tilt
at. That number plates
taken in my source:
4,3,2,1 - change the brightness
light;
5,0 - no change.
Here is how I define brightness
inclined plate. To do this I need
set the coordinates of the center and the current
pieces of the light beam. In theory this is done as follows: to
remember the coordinates of the upper-left corner of the beam
associated with the upper left corner of the screen, then add
the numbers to determine the center this beam and compare the
obtained values with the coordinates of the current piece.
All of this consumes a lot of time
and I went another way: Links
coordinate system with the upper-left corner,
but not the screen and light beam. Coordinates
center with respect to this coordinate system - constant, ie
does not change number. Constant compared with the current
coordinate and, depending on the type of
the current site, call for different procedures (some of them
below). Coordinate upper-left corner of the light beam relative
to the upper-left corner of the screen I use only once in one
step effect, to calculate the starting address in the
attributes.
Procedure for calculating the brightness work like this:
Take for example the plate 1, if it is located to the left than
the center source, then we call this position # 1,
and if the right (ie, its light under a
angle closer to 90 degrees than in the
position # 1), called, respectively,
position # 2.
Table Light is given the form of the beam
light, where the number of the color and radius
ring one of brightness. Brightness I did not
calculate the complex methods, and given two
Table TABL1 and TABL2 (for # 1 and # 2
position). Table Format: 1 - to
0th, 2 - for the first and so on up to 8
brightness.
Coordinates are specified in a separate file. First is the
coordinate of x, then y. But you should bear in mind that the
beam light should not fly over the screen.
I did not do on this test, because
that it takes a long time. By the way
coordinates, you can set the program COORD (located in the
appendix), it 100 sets of coordinates Lissajous figures.
In order to know the speed of the program - remove the
semicolon in the rows with "@". Source you will find in the
appendix, it is called "LIGHT.H" (of course in a format
ruleznogo assembler ALASM).
That's all folx!