APPENDIX D Raw Surface Format
It's a binary machine dependent file, because it's endian dependent. It's a sequence of fixed length records containing the information of each surface dot. The format of each record is:
Type | Size | Description |
unsigned integer | 4 | Number of the associated atom. |
float | 4 | X coordinates. |
float | 4 | Y coordinates. |
float | 4 | Z coordinates. |
byte | 1 | Red color. |
byte | 1 | Green color. |
byte | 1 | Blue color. |
In C language, you can use the following structure to read/write the file:
struct vg_surface { unsigned int AtmNum; /* Atom number */ float x, y, z; /* Coordinates (don't change the order of */ float Val; /* these two fields) */ char Color[3]; /* Color vector */ };