TOD (Animation Data): Difference between revisions
| Revision as of 02:27, 23 October 2026 RemmyLee (File format pages from the Sony File Formats manual) | Revision as of 02:47, 23 October 2026 RemmyLee (Formats: Sony paragraph voice; HMD, RSD extended files, full BS code book; sprite editor formats) | ||
| Line 10: | Line 10: | ||
| ## Overview | ## Overview | ||
| − | The TOD format describes a 3D object along the flow of time. It is used with the extended graphics library (libgs).[^ff240] | + | The TOD format specifies information along the flow of time for 3D objects, and it corresponds to the extended graphics library (libgs). For each frame of a 3D animation, a TOD file describes the data of the objects that are to be created or modified or erased in that frame. The frames are then arranged in time order, so a TOD file consists of a file header followed by frame data.[^ff240] |
| − | For each frame of a 3D animation, a TOD file holds the data for objects that are created, changed or erased.[^ff240] | ||
| − | |||
| − | The frames are arranged in time order.[^ff240] | ||
| − | |||
| − | A TOD file has a file header followed by frame data.[^ff240] | ||
| − | |||
| ## Header | ## Header | ||
| − | The header is 2 words (64 bits):[^ff240] | + | At the top of the TOD file there is a 2-word (64-bit) header, which holds four items. Resolution is the time for which one frame is displayed, and it is counted in ticks of 1/60 second.[^ff240] |
| Table: TOD file header | Table: TOD file header | ||
| Line 33: | Line 27: | ||
| ## Frame | ## Frame | ||
| − | The frames follow the header in time order. Each frame has a frame header followed by packets.[^ff241] | + | The frames follow the header in time order. Each frame consists of a 2-word frame header followed by its packets:[^ff241] |
| − | The frame header is 2 words:[^ff241] | ||
| − | |||
| Table: TOD frame header | Table: TOD frame header | ||
| Line 47: | Line 39: | ||
| ## Packet | ## Packet | ||
| − | Each packet has a one-word packet header followed by packet data.[^ff241] | + | Each packet consists of a one-word packet header followed by packet data. There are several kinds of packets, and the size of the packet data differs between kinds. Even packets of the same kind can have packet data of different sizes.[^ff241] |
| − | The size of the packet data differs between kinds of packets. It can also differ between packets of the same kind.[^ff241] | ||
| − | |||
| − | The packet header is as follows: | ||
| − | |||
| Table: TOD packet header | Table: TOD packet header | ||
| Line 62: | Line 50: | ||
| | 24..31 | Packet length | Size of the packet in words (4 bytes), including the header | | | 24..31 | Packet length | Size of the packet in words (4 bytes), including the header | | ||
| − | The object is a 3D object (a GsDOBJ2 structure) of libgs. The packet data is applied to that object.[^ff242] | + | The object is a 3D object (a GsDOBJ2 structure) of libgs, and the packet data is applied to that object. The packet type gives the classification of the packet data, and the meaning of the flag therefore varies with the packet type:[^ff242] |
| − | The packet type gives the kind of data in the packet:[^ff242] | ||
| − | |||
| Table: Packet type values and packet data contents | Table: Packet type values and packet data contents | ||
| Line 87: | Line 73: | ||
| ### Attribute | ### Attribute | ||
| − | Packet type 0000 holds the attribute of the GsDOBJ structure. The flag is not used.[^ff243] | + | When the packet type is 0000, the packet data sets the attribute of the GsDOBJ structure and the flag is not used. The packet data is 2 words. The first word is a mask in which a 0 bit marks an item that changes and a 1 bit marks an item that does not. The second word holds the new data in the bits of the changing items and 0 in the other bits.[^ff243] |
| − | The packet data is 2 words. The first word is a mask, and the second holds the new value.[^ff243] | + | The default for unchanged bits is therefore 1 in the first word but 0 in the second. The bits of the second word are as follows:[^ff243][^ff244] |
| − | In the mask a 0 bit marks an item that changes. A 1 bit marks an item that does not change.[^ff243] | ||
| − | |||
| − | In the new value the bits of changing items hold the new data. The other bits are 0.[^ff243] | ||
| − | |||
| − | The bits of the attribute are as follows:[^ff243][^ff244] | ||
| − | |||
| Table: Packet data bit-by-bit breakdown | Table: Packet data bit-by-bit breakdown | ||
| Line 113: | Line 93: | ||
| | 31 | Display | 0 display, 1 no display | | | 31 | Display | 0 display, 1 no display | | ||
| − | To switch forced light-source calculation on, the mask is 0xffbf and the new value is 0x0040.[^ff244] | + | For example, to switch forced light-source calculation on, bit 6 of the first word is 0 and the other bits are 1, so the first word is 0xffbf. Bit 6 of the second word is 1 and the other bits are 0, so the second word is 0x0040.[^ff244] |
| + | The rate for value 11 is "50% back + 25% polygon" in this table, while the [TMD](/formats/tmd/) section of the manual gives "100% back + 25% polygon".[^ff244][^ff228] | ||
| + | |||
| ### Coordinate (RST) | ### Coordinate (RST) | ||
| − | Packet type 0001 sets the coordinates of the GsDOBJ structure.[^ff244] | + | When the packet type is 0001, the packet data sets the coordinates of the GsDOBJ structure. The flag then has the following meaning:[^ff244][^ff245] |
| − | The flag bits are as follows:[^ff244][^ff245] | ||
| − | |||
| Table: Flag when Coordinate (RST) | Table: Flag when Coordinate (RST) | ||
| Line 130: | Line 110: | ||
| | 3 | Translation (T) | 0 none, 1 has | | | 3 | Translation (T) | 0 none, 1 has | | ||
| − | The packet data holds the R, S and T values whose flags are set. They appear in the order R, S, T.[^ff245] | + | The configuration of the packet data depends on the rotation, scaling and translation bits of the flag. The data holds only the values whose flags are set, in the order R, S, T. Each R value takes one word, Sx and Sy share one word and Sz takes the low half of the next, and each T value takes one word.[^ff245] |
| − | The values are as follows: | ||
| − | |||
| Table: RST values | Table: RST values | ||
| Line 142: | Line 120: | ||
| | Tx, Ty, Tz | X, Y and Z components of the translation | Integer (1, 31, 0) | | | Tx, Ty, Tz | X, Y and Z components of the translation | Integer (1, 31, 0) | | ||
| − | Each R value takes one word. Sx and Sy share one word, and Sz takes the low half of the next.[^ff245] | + | ### TMD Data ID and Parent Object ID |
| − | ### TMD Data ID | + | When the packet type is 0010, the packet data holds the modeling data ID (TMD data ID) of the real object. When the packet type is 0011, it holds the ID of the parent object. Both IDs are 2 bytes, and in both cases the flag is not used.[^ff245][^ff246] |
| − | Packet type 0010 holds the modeling data ID (TMD data) of the object. The ID is 2 bytes. The flag is not used.[^ff245] | + | ### Matrix Value and TMD Data Body |
| − | ### Parent Object ID | + | When the packet type is 0100, the packet data holds the coord members of the GsCOORDINATE2 structure that the GsDOBJ2 structure points to, and the flag is not used. Packet type 0101 holds TMD data. However, this type is not supported at present.[^ff246] |
| − | Packet type 0011 holds the ID of the parent object. The ID is 2 bytes. The flag is not used.[^ff246] | ||
| − | |||
| − | ### Matrix Value | ||
| − | |||
| − | Packet type 0100 holds the coord members of the GsCOORDINATE2 structure that the GsDOBJ2 structure points to. The flag is not used.[^ff246] | ||
| − | |||
| − | ### TMD Data Body | ||
| − | |||
| − | Packet type 0101 holds TMD data. This type is not supported at present.[^ff246] | ||
| − | |||
| ### Light Source | ### Light Source | ||
| − | Packet type 0110 sets a light source. The object ID becomes a light source ID. Light source IDs are separate from the normal object IDs.[^ff246] | + | When the packet type is 0110, the packet data sets a light source. In this case the object ID becomes a light source ID that is separate from the normal object IDs. The flag has the following meaning:[^ff246] |
| − | The flag bits are as follows: | ||
| − | |||
| Table: Flag when Light Source Packet | Table: Flag when Light Source Packet | ||
| Line 174: | Line 140: | ||
| | 2 | Color | 0 none, 1 has | | | 2 | Color | 0 none, 1 has | | ||
| − | Each axis of the direction takes one word. The color takes one word.[^ff247] | + | The configuration of the packet data depends on the direction and color bits. The direction takes three words for X, Y and Z, and the color takes one word with B, G and R.[^ff246][^ff247] |
| ### Camera | ### Camera | ||
| − | Packet type 0111 sets the viewpoint. The object ID becomes a camera ID. Camera IDs are separate from the normal object IDs.[^ff247] | + | When the packet type is 0111, the packet data sets the viewpoint, and the object ID becomes a camera ID that is separate from the normal object IDs. Bit 0 of the flag is the camera type. Care is needed because the meaning of the other bits changes with this bit:[^ff247] |
| − | Bit 0 of the flag is the camera type. The meaning of the other bits depends on it.[^ff247] | ||
| − | |||
| − | The flag bits are as follows: | ||
| − | |||
| Table: Flag for Camera | Table: Flag for Camera | ||
| Line 192: | Line 154: | ||
| | 3 | Reference angle (z angle): 0 none, 1 has | Translation (T): 0 none, 1 has | | | 3 | Reference angle (z angle): 0 none, 1 has | Translation (T): 0 none, 1 has | | ||
| − | With camera type 0, Tx, Ty and Tz are the camera position. TRx, TRy and TRz are the close-up position, and Z is the angle.[^ff248] | + | With camera type 0, Tx, Ty and Tz are the camera position and TRx, TRy and TRz are the close-up position, and Z is the angle. With camera type 1, Rx, Ry and Rz are the rotation and Tx, Ty and Tz are the translation.[^ff248] |
| − | With camera type 1, Rx, Ry and Rz are the rotation. Tx, Ty and Tz are the translation.[^ff248] | ||
| − | |||
| ### Object Control | ### Object Control | ||
| − | Packet type 1000 has no packet data.[^ff248] | + | When the packet type is 1000 there is no packet data, and the flag gives the operation:[^ff248] |
| − | The flag gives the operation: | ||
| − | |||
| Table: Flag for Object Control | Table: Flag for Object Control | ||
| Line 212: | Line 170: | ||
| ### Extended and Special Commands | ### Extended and Special Commands | ||
| − | Packet type 1110 holds extended commands.[^ff248] | + | Packet type 1110 holds extended commands. Packet type 1111 performs animation control, but the details of these special commands had not been finalized when the manual was published.[^ff248] |
| − | Packet type 1111 controls the animation. The details of these special commands were not final in the manual.[^ff248] | ||
| − | |||
| ## References | ## References | ||
| + | [^ff228]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 2-28, Figure 63. | ||
| [^ff240]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 2-40, Figure 81. | [^ff240]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 2-40, Figure 81. | ||
| [^ff241]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 2-41, Figure 82. | [^ff241]: Sony Computer Entertainment Inc. File Formats. November 1998. Page 2-41, Figure 82. | ||