Information about aditional texture handling options
Sometimes it is pretty difficulty to find the correct X-Y-coordinates for textured polygons. One of the most common examples for this are mountains.
If you are such an lazy scenery designer like me <g> you can try the different features of the bitmap automatic. In this version bitmaps are always aligned to the lower edge or the lowest point of the polygon.
Texture automatic is limited to polygons with a maximum of 16 vertices (vers. 2.29 and later).
T enables Texture Point calculation automatic
for any ..TexPoly's. SCASM tries to use the
whole texture map, but the aspect ratio is
maintained. Only valid with ..TexPoly's
B The same as above, but texture aspect ratio
is not maintained. This may result in a
different scaling for the bitmap in x- and
y- direction. Only valid with ..TexPoly's
R This flag reverses the bitmap in y direction
(up/down). Only valid with ..TexPoly's. This
works only with the T or B flag active.
aditional flags in version 2.04
S scale
maybe changed in next version !!!
With the above flags allone you cannot
control the size of the pixels (scaling).
If this flag is used SCASM expects a
scaling factor for the next parameter. The
scaling factor can be a fractional number
or even an expression.
This scale factor can be calculated as:
(last_usable_pixel
- first_usable_pixel) / longest_dist
If you want to use the whole bitmap and your
distance is 25 meters for your largest
polygon edge, this is simply:
255 / 25 = 10.2
This scale factor is used for X and Y
scaling.
L x1 y1 x2 y2
This flag indicates that 4 aditioanl
parameters follow.
These parameters are bitmap coordinates to
limit the usable bitmap area for this
polygon. SCASM tries to stretch this area
to fit the polygon. If this flag is not
used SCASM asumes
x1 = 0, y1 = 0, x2 = 255, y2 = 255
for the first and the last usable pixel.
This is the whole bitmap.
N No reset of the S and L values.
Normally the scale factor and the limit
values are resetted everytime a polygon
is computed. If you want to use the
values from a previously defined polygon,
use this flag to tell SCASM not to reset
these values.
example:
...
TexPoly( ats [127/25] L 0 0 127 127 0 1 2 )
TexPoly( atn 1 2 3 )
...
In this example only a small part of the
bitmap is used and the bitmap scale factor
is calculated to fit a polygon with up
to 25 meters width (x) and height (y).
The second polygon is calculated with the
same scaling and pixel limits since the
previous values are not resetted.