The 006100230000
line has something to do with vertex description rather than polygons.
There are various ways that the polygons are defined. Polygons can be 3 or 4 sided, although lines will be included in this category as well.
1. 004C and 0080
Example
004CBEBEB000 The 004c line is always followed by one or more 0080 line:
0080002B00280003
00800028002C0003
This relates to nontextured triangles, and the 004c line gives which palette position will define the colour at each of the 3 vertices. So, using the first 0080 line, vertex 2b
will be coloured with the colour at palette position be
. Vertex 28
with colour be
and vertex 03
with colour b0
.
This will result in a triangle with different colour corners, but the colours are somehow blended together as a gradient between the vertices.
2. 004E and 0081
This are the 4 sided version of the above:
Eg
004ED4CCCCD4
008100560052002C0028
3. 0002 and 0071
These relate to triangles of uniform colour. The 0002 line sets the colour and used vertices of the first triangle. If there are more triangles of the same colour needed, the 0071 line is used.
Example:
000200C4004000420039
0071004100400039
00710008003B003A
007100090008003A
000200D0004000390042
0071004100390040
00710008003A003B
Here, the first 0002 line sets the colour at palette position c4 to be used
. This colour will be used for the following 0071 triangles, after which the second 0002 line changes the colour to d0
.
4. 0003 and 0072
This is the 4 sided equivalent of 0002 and 0071
Example
000300B900210020001D001C
0072001C001D00250026
5. 009F
Example:
3 sided
009F000C0032030100CA00C900CB009D000900020001
00000000____0000____________0000____________
__________T_______C1__C2__C3______V1__V2__V3
(the 0’s are used as filler to try to create some whitespace
on this site, although it still doesn’t line up properly 🙁)
This is used for textured polygons, but if the texture is not used, also contains the colours (C1,C2,C3) to be used at the vertices to produce a shaded
polygon instead. In the example above, which is taken from tent_3.3, the texture(T) is defined by the number 32h or 50 in decimal notation. Some cross referencing is needed to find out what this means.
In the 3folder there are some .ini files. Here are the relevant parts of red1000.ini
[dir]
TM=red1000
[globaltextures]
1=cam3_9
2=cam3_10
3=plane_21
4=material
5=mattdead
6=mob_5
7=fx_4
.
.
[surface]
.
.
48=txtr 10,(192,128),(223,128),(223,159),(192,159) ;BOT ROCK
49=txtr 10,(224,128),(255,128),(255,159),(224,159) ;TOP ROCK
50=txtr 4,(0,160),(31,160),(31,191),(0,191) ;N CANVAS
51=txtr 4,(32,160),(63,160),(63,191),(32,191) ;NE CANVAS
.
.
In the [surface] section, it can be be seen that 50 corresponds to txtr 4. According to the [globaltextures] section 4=material
which finally gives the filename of the texture to use. This is material.tm from the red1000 directory in this case.
The coordinates given in the [surface] section give which part of the texture to use since the texture size is fixed as 256x192. So, in this case the part used is outlined in red.
The 4 sided example is shown here:
009F000E0036040100CA00C900C800C9009E0004000300060005
There is also a simpler version of 009F to be used when it is not required to have separate colours for each vertex if the texture is not used. A single colour is specified instead.
Example:
009F00080038010300CC009E0009000400050008
Here the colour cc
is applied to the whole 4 sided polygon if the texture 0038
is not used.
6. 002E and 002F
This is used where specific parts of a texture need to be used. The following example is a 3 sided polygon taken from sea.3:
002E0000000300BF000000880032008F0000
002F0003001800120017
The 002E part gives x any z coordinates to define which part of the texture (the filename of the texture is given in the header
of the .3 file) shall be used with the vertices defined in the 002F line. Here, the coordinates are:
Vertex 18, x=bf, z=00
Vertex 12, x=88, z=32
Vertex 17, X=8f, z=0
There is also a 4 sided version of this
7. 0047 and 008E
Example:
00470009000400010020002000200020003F0001003F
008E000400110010000E000D
The 0047 opcode can be treated the same as the 002E opcodes except the texture used is taken from the redseaXXXX.ini file and not that as described in the header. Immediately after the 0049 is the index of the texture used, which in this case 0009. Since the index system starts at 0 in the .3 file, but 1 in the .ini file, we have to add 1 giving (in this case) the texture fx_13.
8. 0001
This is used to draw a line.
In this example:
000100C800420041
A line is to be drawn between vertex 42 and 41 using palette colour C8. Since there is no thickness parameter, it is currently unknown how this system works at different viewing distances.