• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# D3DIM ordering

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1Pseudo  Members

Posted 15 September 1999 - 11:59 AM

What is the proper order to do a scale, translation, and rotation...

if I have:

D3DVALUE scale;
D3DVECTOR pos,dir;
D3DMATRIX total, temp;
Identity(total);

then when I do this:

Scale(temp, scale);
Multiply(total, total, temp);
Rotate(temp, dir)
Multiply(total, total, temp);
Translate(temp, pos);
Multiply(total, total, temp);
pd3dDevice->SetTransform(D3DTRANSFORMSTATE_WORLD, &total);

Now, this should scale, then rotate around its local coord system, and then translate...but it is not working right. I think I read the the order must be fliped screwy when working with matrices. Could someone modify the above code, so that I can see what is going wrong?

### #2NuFAN  Members

Posted 15 September 1999 - 11:59 AM

1) Are you sure you do all your matrix-functions in the correct way ? If not, try out the functions from D3DUtil.cpp and then change back to your functions.

2) I normally multiplied all matrices in one function and it worked fine for me. This is also used in the DX SDK, so you could have a look at that. If you need some source for this, have a look at d3dutil.cpp and d3dmath.cpp, the functions can be found there.

3) I used to multiply with the rotation matrix at the beginning and then with the translation matrix, but I'm not sure if this does matter. (I'm not that experienced with 3d-coding)

I hope I could help a bit.

CU

------------------
Skullpture Entertainment
#40842461

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.