Hi All
My long term goal is to mod the actual 3D model files in Tornado. For example, it would be nice to add more 3D points, vertices and surfaces to the Tornado 3D model which at the moment looks like this (see below).
The 3D model is very 1993-ish. For an era when most people were running Intel 286 and 386 PCs!
The purpose of this post is to request for help with GeoGebra. If you know how to use GeoGebra, I appreciate it if you could reply to this post. I am trying to visualise the 3D Model of objects in Tornado. If I can crack the code of the 3D model files, then I stand a better chance of modding the 3D objects themselves in Tornado.
The object data files are found in inside D:\TORNADO\VISUAL\OBJECTS. For the time being, I trying to understand the code inside the file D:\TORNADO\VISUAL\OBJECTS\MOBILE\
LGB.INC. I am using a 3D Plotter software named GeoGebra. With GeoGebra, I can translate the lines 004-0031 of the code below (they refer to 28 (x,y,z) points) into plot data. This is the easy part.
;--- Start of D:\TORNADO\VISUAL\OBJECTS\MOBILE\
LGB.INC code
Line 001: COL_DK_GREY EQU 8
Line 002:
Line 003: lgb OBJECTHEADER <OBJ_SCALE16,1024,-1,1,COL_GREY4,3,5,3>
Line 004: DB 064,072,064 ; 0
Line 005: DB 062,070,064 ; 1
Line 006: DB 066,070,064 ; 2
Line 007: DB 064,074,064 ; 3
Line 008: DB 062,066,064 ; 4
Line 009: DB 066,066,064 ; 5
Line 010: DB 066,056,064 ; 6
Line 011: DB 062,056,064 ; 7
Line 012: DB 070,060,064 ; 8
Line 013: DB 058,060,064 ; 9
Line 014: DB 064,070,066 ; 10
Line 015: DB 064,070,062 ; 11
Line 016: DB 064,066,062 ; 12
Line 017: DB 064,066,066 ; 13
Line 018: DB 064,056,066 ; 14
Line 019: DB 064,056,062 ; 15
Line 020: DB 064,060,058 ; 16
Line 021: DB 064,060,070 ; 17
Line 022: DB 064,058,064 ; 18
Line 023: DB 066,060,064 ; 19
Line 024: DB 064,060,066 ; 20
Line 025: DB 062,060,064 ; 21
Line 026: DB 064,060,062 ; 22
Line 027: DB 064,062,066 ; 23
Line 028: DB 066,062,064 ; 24
Line 029: DB 064,062,062 ; 25
Line 030: DB 062,062,064 ; 26
Line 031: DB 064,056,064 ; 27
Line 032: DB -1
Line 033:
Line 034: DW OFFSET lgb_1
Line 035:
Line 036: EVEN
Line 037:
Line 038: lgb_1 DW 74
Line 039:
Line 040:
Line 040: LGB_0 LABEL BYTE
Line 041: DB 00Ch,COL_GREY4,COL_GREY4,00,04,02,-1 ; face 1
Line 042: DB 00Ch,COL_GREY4,COL_GREY4,20,00,22,-1 ; face 8
Line 043: DB 00Ch,COL_GREY4,COL_GREY4,26,08,24,10,-1 ; face 14
Line 044: DB 00Ch,COL_GREY4,COL_GREY4,36,34,32,-1 ; face 11
Line 045: DB 00Ch,COL_GREY4,COL_GREY4,36,18,16,-1 ; face 11
Line 046: DB 00Ch,COL_GREY4,COL_GREY4,28,40,44,30,-1 ; face 8
Line 047: DB 00Ch,COL_GREY4,COL_GREY4,50,54,46,26,06,24,-1 ; face 8
Line 048: DB 00Ch,COL_GREY4,COL_GREY4,48,54,52,08,06,10,-1 ; face 8
Line 049: DB 00Ch,COL_GREY4,COL_GREY4,14,42,38,12,-1 ; face 9
Line 050: DB -1
Line 051:
Line 052: EVEN
;--- End of D:\TORNADO\VISUAL\OBJECTS\MOBILE\
LGB.INC code
Here's what the LBG1000 looks like in the game:
As you can see, after plotting the 3D points in GeoGebra, the object clearly resembles the LGB1000 laser guided bomb.
In this video, I also MANUALLY create some polygon surfaces.
It is the section of lines 041-049 of the LGB.INC code above, referring to faces (polygons?), that I do not know how to convert the code into GeoGebra code. Reproduced below again:
Line 040: LGB_0 LABEL BYTE
Line 041: DB 00Ch,COL_GREY4,COL_GREY4,00,04,02,-1 ; face 1
Line 042: DB 00Ch,COL_GREY4,COL_GREY4,20,00,22,-1 ; face 8
Line 043: DB 00Ch,COL_GREY4,COL_GREY4,26,08,24,10,-1 ; face 14
Line 044: DB 00Ch,COL_GREY4,COL_GREY4,36,34,32,-1 ; face 11
Line 045: DB 00Ch,COL_GREY4,COL_GREY4,36,18,16,-1 ; face 11
Line 046: DB 00Ch,COL_GREY4,COL_GREY4,28,40,44,30,-1 ; face 8
Line 047: DB 00Ch,COL_GREY4,COL_GREY4,50,54,46,26,06,24,-1 ; face 8
Line 048: DB 00Ch,COL_GREY4,COL_GREY4,48,54,52,08,06,10,-1 ; face 8
Line 049: DB 00Ch,COL_GREY4,COL_GREY4,14,42,38,12,-1 ; face 9
Line 050: DB -1
Line 051:
Line 052: EVEN
If you can shed any light on how to translate lines 41 to 49 of LGB.INC into GeoGebra code, I would be most grateful. I am also attaching the Geogebra export file used in the Youtube video, as well as the original LGB.INC file from Tornado 1.0. I am not sure where this road will lead to, but it's worth a shot.
Cheers and regards
Frankie Kam
UPDATE 4th December 2018I've got it now. Here's how it works.
DB 00Ch,COL_GREY4,COL_GREY4,00,04,02,-1 ; face 1means Face1 is made up of these three Vertices: Vertice0, Vertice2 and Vertice1. Notice that the values between the COL_GREY4 and -1 are made up of even values. Those even values are always the VerticeNum multiplied by 2. So the "00,
04,02,-1 ; face 1[/size][/font] refers to Vertice
2.
DB 064,072,064 ; Vertice0
DB 062,070,064 ; Vertice1
DB 066,070,064 ; Vertice2and
DB 00Ch,COL_GREY4,COL_GREY4,14,42,38,12,-1 ; face 9means that Face9 is made up of
Vertice7, Vertice21, Vertice19 and Vertice6. The values are the vertex number * 2. Effectively the index value for the look-up table. Saves doing the * 2 in code.
The polygons are always clockwise in their vertex order. If you were looking straight-on at a polygon, the vertices would be clockwise.
Many thanks to Kevin J Bezant for this information. Now this makes sense to me.