The first byte in the parameter record stores the number of characters in the parameter name. Parameter names can have from 1 to 127 characters (using the character sets A-Z, 0-9 and underscore) although four characters should generally be considered a minimum. The first six characters of each parameter name must unique. The character count is always used as a positive number regardless of the actual sign of the stored value. In the example below the first byte is 0xF6h indicating a locked parameter with a ten-character name.
|
Byte |
Length (bytes) |
Description |
|
1 |
1 |
Number of characters in the Parameter name (1 to 127) this value may be set to a negative number to indicate that the parameter is locked. |
|
2 |
1 |
Group ID number (positive) to which the Parameter belongs (+1 to +127). |
|
3 |
N |
The parameter name (ASCII characters normally upper case numeric or underscore only) |
|
3 + n |
2 |
A signed integer offset in bytes pointing to the start of the next group/parameter. |
|
3 + n +2 |
1 |
Length in bytes of each data element -1 for character data 1 for byte data 2 for integer data (16-bit integers) 4 for floating-point (REAL) data |
|
3 + n + 3 |
1 |
Number of dimensions (0-7) of the parameter 0 if the parameter is scalar. |
|
3 + n + 4 |
D |
Parameter dimensions. |
|
3 + n + 4 + d |
T |
The parameter data. |
|
3 + n + 4 + d + t |
1 |
Number of characters in the parameter description |
|
3 + n + 4 + d + t + 1 |
M |
Parameter description |
Figure 14 The Parameter format.
The locking mechanism was originally implemented to prevent casual users from changing parameters using parameter examination and editing programs (such as PRM and the C3Deditor). Its effectiveness depends on the degree to which locking is supported by the currently available utility programs and the consistency with which applications that create C3D files apply the locking property. The fact that a parameter has been locked by one applications does not prevent any other application from changing it locking simply provides a flag that may be utilized by other locking aware applications.
It is strongly recommended that applications do not allow users to change locked parameters applications that do permit the editing or modification of locked parameters should include a method of restricting this feature to prevent the casual user from corrupting C3D data files.
The second byte in the parameter header contains the parameter ID number this is always a positive value between +1 and +127 and is used to link the parameter to a specific group. A parameter with a positive ID value that matches a negative group ID number belongs to that group. Note that the actual value chosen for a group ID number is not fixed and may vary from one C3D file to another. It is not required that group ID numbers are assigned in a contiguous sequence. In the example below the ID number is 0x01h indicating that this parameter belongs to the group described earlier, in fact this is the parameter POINT:DATA_START within this file.

Figure 15 The DATA_START Parameter is locked and has a ten-character name.
The string containing the parameter name starts at the third byte in the parameter record. Parameter names can have from 1 to 127 characters (using the character sets A-Z, 0-9 and the underscore _ character) although four (4) characters should generally be considered a minimum. The first six characters of each parameter name must be unique within its group for compatibility with many older software applications.
A word pointer to the next parameter record structure follows the parameter name string unless this is the last parameter in the parameter section. The last parameter in the parameter section always has a pointer value of 0x0000h to indicate that there are no more parameters following.
A single byte follows which describes the parameter type character, byte, integer or floating-point. Note that floating-point data can be stored using any one of three different formats, which is usually determined by the hardware that originally generated the C3D file. These are Intel, DEC, or MIPS formats. All floating-point values in a given C3D file will use the same floating-point format as recorded in the fourth byte of the parameter record header. Signed integer data can be stored in two different ways (little endian for DEC/Intel, and big endian for MIPS). Traditionally, all integers in a parameter section are signed integers with a range of 32768 to +32767 and all bytes are signed bytes with a range of 128 to +127.
The next byte in the parameter record is the number of dimensions in the parameter, which can be from zero (0) to a maximum of seven (7) dimensions. A parameter with zero dimensions is a scalar. If the parameter is a matrix then the actual parameter dimensions (e.g. 2 by 3, 6 by 6 etc) are stored in the next two bytes. This is then followed by the parameter data itself.
A single byte follows the pointer to the next parameter data structure this records the length of the parameter description string (0-127 characters), which immediately follows this byte. The parameter description can contain mixed case characters and is generally used to provide a human-readable description of the parameter function.
In the example below, the parameter RATE in the group POINT is stored as follows:
|
0xFCh |
0xFFh |
0x52h |
0x41h |
0x54h |
0x45h |
0x0Eh |
0x00h |
0x04h |
0x00 |
|
-4 |
-1 |
R |
A |
T |
E |
14 |
4 |
0 | |
|
0x00h |
0x00h |
0xF0h |
0x42h |
0x05h |
0x56h |
0x69h |
0x64h |
0x65h |
0x6Fh |
|
120.00 (Intel floating-point) |
5 |
V |
i |
d |
e |
o | |||
Figure 16 - A simple parameter record stored as a floating-point value.
In this case, the RATE parameter is correctly locked (the length is negative) and it belongs to the GROUP with a group ID of 1. The POINT:RATE parameter is a floating-point value and is stored in Intel format as a scalar with a description of Video.