View Full Version : Spline point positions in world space

06 June 2008, 03:58 PM

I'm writing an simple exporter (a SceneExport) to describe a level in XML for a game I'm writing. One of the requirements is to specify a path using splines.

I'm able to get to this data quite easily by

- creating a ShapeObject from a found Shape (spline)
- creating a PolyShape
- iterating through all it's lines
- for each line go through all the points and record them

My problem is that the point data appears to be in local space. I test this by putting the first point at (0,0,0) and checking the output. The example IGameExporter (which I'm not using) also seems to have this problem.

After much sdk documentation reading, I'm thinking this is a local space to world space conversion issue.

I tried the obvious (well to me)

Matrix3 tMatrix = inode->GetObjectTM(mInterfacePointer->GetTime());
Point3 p = line->pts[j].p;

Which had no effect.

Any pointers in the right direction is much appreciated.

I've just started Max plugin dev, so I hope this makes sense. I also couldn't find any previous posts addressing this.

Thanks in advance!


3d studio max version: 9

06 June 2008, 12:32 AM
Worked it out. Incase it might help anyone.

Where p is a Point3 object in localspace.
p = p * n->GetObjectTM(mInterfacePointer->GetTime());


CGTalk Moderation
06 June 2008, 12:32 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.