Game Development Reference
In-Depth Information
*CONTROL_BEZIER_POS_KEY 9600 -106.2602 97.0334 146.6617
-0.0456 0.0000 -0.0301 0.0456 -0.0000 0.0301 0
*CONTROL_BEZIER_POS_KEY 12000 110.8874 97.0334 143.4107
-0.0460 -0.0000 0.0097 0.0460 0.0000 -0.0097 0
*CONTROL_BEZIER_POS_KEY 16000 -1.1630 97.0334 48.6045
0.1021 0.0000 0.0377 0.0000 0.0000 0.0000 0
}
*CONTROL_ROT_TCB {
*CONTROL_TCB_ROT_KEY 0 1.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 4000 -0.0000 1.0000 -0.0000 1.8309
0.0000 0.0000 0.0000 0.0000 0.0000
*CONTROL_TCB_ROT_KEY 12000 0.0000 -1.0000 0.0000 1.2898
0.0000 0.0000 0.0000 0.0000 0.0000
}
*CONTROL_SCALE_BEZIER {
*CONTROL_BEZIER_SCALE_KEY 0 1.1700 1.1700 1.1700 0.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-0.0001 -0.0001 -0.0001 0
*CONTROL_BEZIER_SCALE_KEY 9600 0.6061 0.6061 0.6061 0.0000
0.0000 0.0000 0.0000 0.0001 0.0001 0.0001
0.0000 0.0000 0.0000 0
}
}
Implementing a 3DS ASCII parser
To parse a 3DS ASE file we will use a C3DSAscii class. Before getting into
the details of parsing individual sections, we will implement three useful
functions to help when reading the file. The file uses matching curly
braces to contain subsections. The purpose of the function GetSection-
End is to locate the file position of the closing brace. The function takes
an MFC class CStdioFile as the sole parameter. This class is a wrapper
for a standard text file. The function starts by initializing two variables,
start records the file position when the function is called and count is set
to one, indicating that one opening curly brace has been read. The
function is designed to be used after reading the opening curly brace.
After this initialization, the function enters an infinite loop with two exit
conditions. The first exit condition occurs if an attempt to read from the file
using ReadString returns FALSE. If this occurs then the matching end
curly brace is not present and so the data are not in a suitable format or
Search Nedrilad ::




Custom Search