PDA

View Full Version : help parsing TrueSpace scn text file



howie
12-08-2005, 01:20 PM
I have successfully parsed the scn text file except for one thing. In the file by an object you'll see something like this.

Name Cube
center 42.933 72.6213 1
x axis 1 0 0
y axis 0 1 0
z axis 0 0 1

My question is about the x axis, y axis, z axis values. When the numbers are like the above, I can ignore them but by moving the objects around in TrueSpace, I can get something like this...

Name Cube
center 42.933 72.6213 1
x axis 0.729564 0 0.683913
y axis 0 1 0
z axis -0.683913 0 0.729564

Now my parsed data doesn't work because my objects are someplace else. It's apparent I need to use the x axis, y axis, z axis data in some way but how?

In their file format doc, this is all it says...

Local Axes

Some chunks define their own local set of axes. This consists of a position or center for the axes and directions for the X, Y, and Z axes. These are given in World coordinates. The X, Y, and Z axes should be perpendicular to each other and are not relative to the center of axes.

ASCII format:
"\ncenter %g %g %g"
"\nx axis %g %g %g"
"\ny axis %g %g %g"
"\nz axis %g %g %g"

The data sort of looks like a 3x3 matrix. I have done many tests but have have not figured out how to properly use these values. I can only assume it is used on the center values... but how?

True Space Tech support can't help in these matters and my questions go unanswered in the TrueSpace forums.