#### Archived

This topic is now archived and is closed to further replies.

# BIG problem in DIRECT3D IM........

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

## Recommended Posts

##### Share on other sites
Can Somebody HELP????????

##### Share on other sites
Can Somebody HELP????????

##### Share on other sites
Somebody Help Me!!

##### Share on other sites
Somebody Help Me!!

##### Share on other sites
Oh man, you are truly desperate. You need to learn to have patience when trying to get answers from any forum. There is no need to post more than once, per day at least. If you post as you have this time, people will only be annoyed with you and ignore your question. Just a friendly advice.

From what I can see you update the objects position and orientation correctly, the problem is when you compute the transformmatrix. If you have position and rotation angles (which you do) the matrix can be computed like this:

D3DMATRIX T,Ry,Rx;
D3DUtil_SetRotateXMatrix(Rx, RotX);
D3DUtil_SetRotateYMatrix(Ry, RotY);
D3DUtil_SetTranslateMatrix(T, PosX,PosY,PosZ);

D3DMATRIX WorldMtx;
D3DMath_MatrixMultiply(WorldMtx, Rx, Ry);
D3DMath_MatrixMultiply(WorldMtx, WorldMtx, T);

- WitchLord

##### Share on other sites
It does not work as expected.
when the object is rotated it rotates around the origin and not around its axis.how do i fix this??

help!!!!!!!

##### Share on other sites
You must rotate the object first then translate it. If you say it is rotated aroung world origin you have translated first and then rotated it.

The matrix computation should be done from scratch each time. If you do it as you do in your program where you multiply the old transform matrix with the new you will not get the expected transformation, and you will also get numerical errors that distorts your objects.

- WitchLord

• 10
• 13
• 52
• 11
• 15