Quote:> I have written a 3ds file reader for use in my game. I have run into a
bit
> of an issue it seems. The 3ds file does not store world corrdinates for
> each mesh, instead it stores a 4x3 matrix for each mesh, and the vertices
> are based on that. I would like to know how to apply this matrix to each
> vertex in code, so that I can store the world coordinates instead of the
> modified ones. Does anyone have experience with this?
Actually the vertices are defined in world coordinates, and the matrix tells
what the matrix was. If you want to define the vertices in model
coordinates, you have to multiply'em by inverse of the 4x3 matrix. You need
to do this if you want to begin to apply the animation/keyframing tracks,
those are defined in local (=model) coordinates relative to each node's
parent.
Last but not least, there is offset (=pivot) transformation which is applied
before drawing the node, but is not inherited.
So ; if you don't care about hierarchy or animation, you can simply draw in
world coordinates.