Sign in to follow this  

My Remdial Linear Algebra vs 3d Studio Max ASE Files

This topic is 4691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this