My Remdial Linear Algebra vs 3d Studio Max ASE Files

Started by
1 comment, last by nooperation 19 years, 2 months ago
I'm writing a small game in DirectX 9.0c and Visual C++. I'm having my artist lay out the level in 3d studio max and export it as an ASE file. Originally I was using the *TM_POS attribute to position my objects. But of course this doesn't take rotation into account. So, I changed to use the *TM_ROW0 - *TM_ROW3 attributes to get a nice transformation matrix. So, from what I'm reading in now versus what my old transformation matrix (for a simple unrotated object) was has a slight discrepency, as follows: Old TM_POS matrix ============= 1 0 0 0 0 1 0 0 0 0 1 0 x y z 1 New TM_ROWx matrix ================= 1 0 0 0 0 1 0 0 0 0 -1 0 x y z 1 This makes my objects light funny (very dark), and I'm guessing that maybe I'm looking at the backs of the triangles (forgive me if I just don't know what I'm talking about). Can someone tell me what this -1 in the 3,3 position of the matrix is doing to my object and what kind of transformation I could do to undo it? I tried multiplying the x,3 positions by -1 and it turned the lighting back to normal, but made my rotation backwards on my objects that were actually rotated. Thanks for all your help.
Advertisement
if it is lighting backwards, then you must have culling off.
if this is the case, turn culling on and index your triangles
the opposite way round and it could fix it without having
to modify the matrix.
but this might piss you off cause you wanna do it properly,
i usually say that if it works who gives a shit... especially
if you are just trying to finish a game.
stop picking your nose
I figured it out. This page about coordinate systems on MSDN gave me the plan. I needed to not only swap y and z, but negate the 3rd row of the transformation matrix.

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c_Summer_04/directx/graphics/programmingguide/GettingStarted/3DCoordinateSystems/coordinatesystems.asp

This topic is closed to new replies.

Advertisement