gfx
ZXNet echo conference «code.zx»
From Arseniy Astapenko → To All 20 April 1998
* Forwarded from BBRZXNet
from : SAV/D.M.G./U.A.
to: All amateurs!
subj : All sorts of useful things
date : 12-04-98
time: 21:48
Hello All!
I absolutely don’t want to sleep, but I want to tell
you need some information for general development, so to speak:
So, excerpts from the book 'Applied Graphics'
Inforcom.
Methods for presenting graphic information:
1. Raster graphics
2. Vector graphics
3. Block graphics
Let's move on to analyzing each one separately:
1. Raster - the image on the screen consists of
pre-defined 'pictures' small (not always)
sizes that overlap each other and that's it
put the image together. Almost all graphics on
Spectrum is exactly like that.
2. Vector - the image is constructed according to the given
situation, it is not known in advance, so it is calculated
according to formulas and is drawn by straight segments (vectors,
which is called vector). Possibly an incalculable number
combinations, which ensures undoubted success with
toy lovers. These are games such as Elite, Academy,
Tau Ceta II. Polygons are a separate subclass
simulators where painting is used seriously
planes of figures with textures, hiding invisible contours
and collisions (object deformations). K
such games include: Battle Command and CarrierCommand.
3. Block - the poorest, but also the most economical.
Obviously, all system programs use block
graphics. The only exception is Windows'95. So -
block graphics are a simplified version of raster graphics.
All objects consist of identical pieces (blocks) of
which the object is assembled. So, for example, block
graphics are text on the screen - the text itself is codes
characters, and their image is a font. Illustrative examples of games,
using block graphics - Manic Miner and boulder
Dash.
I don't want to describe raster graphics in detail, because...
its use is obvious, but I’ll tell you a couple of interesting ones
approaches that are of great interest:
Interactive graphics:
In many older games, the question of character
The properties of an object were decided by its color. Subsequently
this has become unacceptable - it is very obvious and not beautiful.
Therefore, the concept of interactive graphics arose. Together with
each graphic object (its attributes) is stored
the same number of bytes of interactive attributes (i.e.
characterizing the properties of an object), how many color
attributes. Somewhere in memory an area of size was allocated
768 bytes, where by analogy with color attributes
interactive attributes were entered. Next question: what
what's ahead of us? - solved very simply - enoughwas to look in this shadow attribute screen
properties of the next familiar place and determine how in such
situation to act (explode, award a bonus, etc.).
I hope you get the main idea.
'Clashing' and the fight against it.
Everyone knows for certain that the familiar places of points
there is only one byte of attributes, which does not allow
'spread' your wings. The phenomenon of clashing occurs. Clashing
overlay of attributes, i.e. for example, a white tank ran into
green grass, in the area of something either the tank turned green or
the grass turned white.
There are several conclusions that should be recognized:
1. One of the colors when preparing images should be
be black color.
2. In the overlay and background image, black
One should have ink and the other paper.
3. The overlay image should be black
paper, while the background one has ink.
These three rules will help you get rid of problems
clashing when superimposed by xor. Actually it should
experiment with both mask and or overlay,
but everyone can do it.
3D raster graphics:
Sprites for such graphics are pre-drawn in
any projection (isometric, cabinet) and
adjust to each other according to or.
Rule 4. If a sprite is superimposed on the background, then it’s better
use xor, if the sprite is on a sprite, then or.Simplify the background image to a minimum, and from using
refuse color palettes.
Vector graphics:
A very powerful vector graphics device is still weak
used on Spectrum. Mostly it to us
demonstrated in demos and intros. Serious programs
domestic programmers using vector
There are no graphics, because its use requires serious
knowledge of stereometry, descriptive geometry,
matrix algebra, etc., which I actually don’t know. On
at this stage, everything I know is so limited and
inaccessible to others, which I decided not to 'disclose'
military secret' and modestly remain silent.
Block graphics:
Almost everywhere we can see block graphics.
It MUST be in any program, because... font is
already block graphics. It is obvious that most people
The concept of block graphics is as necessary as an orange to a pig. But that's all
Anyway, I'll tell you something useful:
Creating three-dimensional effects in block graphics.
The algorithm of work is obvious:
Let's say we have a flat object consisting of
cubes from which a shadow is cast. This object
has a size of 4 x 4.
@ @@
@
@@@@
Algorithm:
A cycle of bypassing all blocks moving from the light source,
i.e. if the source is on the left and above, then we move to the left
to the right along the lines and from top to bottom.We check each block for the presence of a neighboring block in
side away from the source. In our case it is
right-down.
If there is no block, then in its place is drawn
shadow, with corresponding direction.
This algorithm is universal, but
in most cases you have determined in advance
the location of the light source giving the shadow, therefore
the algorithm is greatly simplified to a fairly easy one
implementation.
I hope I haven't burdened you too much with these
pearls. In general, the source of this information is 'Applied
graphics'. But due to the fact that this publication is a little
oak, I chewed all those foggy thoughts that were there
expressed. It is worth noting that this is not a graphics issue.
exhausted. There are a huge number of tricky tricks
storage, output, graphics compression. Everyone doesn't know them
who. I suggest you write about those tricks and powerful
techniques that you have dug up somewhere, regardless
where, be it music. editor or simple converter.
The only thing you shouldn't do is sit silently
fold your arms and stare blankly at the monitor. It's quite possible
that someone just lacks the technique with which
you own but don't want to share.
So, I encourage you to be active, tell us about
What interesting things do you know that others don’t know? With the best wishes, SAV.