What is a 3D2 file?
A file with .3D2 extension is a CAD-3D 2.0 file that stores multiple 3D objects and information about these objects. The lightning and colour palettes information used by the 3D objects are all stored in this file. A single file can hold up to 40 objects. 3D2 had been used as an early format for computer animations. 3DS files can be opened with Quick3D application software.
3D2 File Format
The 3D2 file format is similar to the older file format and comprises of two parts.
- A 256-byte header which contains information about the number of objects contained in the file, the light settings and the colour information.
- A repeating structure of data that defines the 3D objects in the file.
3D2 file format resembles to the older file format, but differs in that it doesn’t rely on the Fast Floating Point library (LIBF) of Motorola. It considerably reduces the storage requirements by storing each coordinate in a two-byte word instead of a four-byte floating point value.
3D2 Header
Field | Type | Value |
---|---|---|
File ID | WORD | $3D02 |
Count of Objects in file | WORD | 1-40 |
Light source A on/off indicator | WORD | (0=off, 1=on) |
Light source B on/off indicator | WORD | (0=off, 1=on) |
Light source C on/off indicator | WORD | (0=off, 1=on) |
Light source A brightness | WORD | (0-7) |
Light source B brightness | WORD | (0-7) |
Light source C brightness | WORD | (0-7) |
Ambient light brightness | WORD | (0-7) |
Light source A Z position | WORD | (-50 through +50) |
Light source B Z position | WORD | (-50 through +50) |
Light source C Z position | WORD | (-50 through +50) |
Light source A Y position | WORD | (-50 through +50) |
Light source B Y position | WORD | (-50 through +50) |
Light source C Y position | WORD | (-50 through +50) |
Light source A X position | WORD | (-50 through +50) |
Light source B X position | WORD | (-50 through +50) |
Light source C X position | WORD | (-50 through +50) |
Object color palette | 16 WORDs | (BIOS format) |
Color group base array | 16 WORDs |
Color Group Base Array
The palette in the 3D2 file must be accompanied by the colour group base array which indicates the index of the first colour in the group to which that colour belongs. The following is an example palette that contains a background colour of black, followed by five reds, five greens and five blues.
INDEX | COLOR | BASE |
---|---|---|
0 | 000 | 0 |
1 | 100 | 1 |
2 | 200 | 1 |
3 | 300 | 1 |
4 | 400 | 1 |
5 | 500 | 1 |
6 | 010 | 6 |
7 | 020 | 6 |
8 | 030 | 6 |
9 | 040 | 6 |
10 | 050 | 6 |
11 | 001 | 11 |
12 | 002 | 11 |
13 | 003 | 11 |
14 | 004 | 11 |
15 | 005 | 11 |