Skip to main content
gamedev.net
🔒 Locked

d3d matrix

Started by Trugath 1 reply 400+ views
Original Post
Trugath
Trugath
Ive been having big problems getting my scene and object matrix''s set up. i create the scene fine but when i blit the surface the objects arn''t there. i beleave i have mis oriented the camera and/or habe the objects in the scene placed wrongly. is there anyplace i can get good information on matrix''s becouse all the ones i have read allready are vary vauge and dont explain what each value in the matrix does apart from _43. ta, sorry im a bit of a newbie at this. ---------- ---Trugath
dennis428
dennis428
Sure, I can help a bit.

First, to be sure that the blitting worked, try setting an other ambient color. For example 0x0c0c0c0c. If the screen changes color, the viewport is blit.

lpd3dDevice->SetRenderState( D3DRENDERSTATE_AMBIENT, 0x0c0c0c0c );

Second, the DirectX SDK help has a really good part on matrices. You should really check that one out.
Know that if you set an Identity Matrix,
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
nothing moves.

Then try to experiment with the _41, _42 and _43 values (bottom row) of a matrix. These represent the translation (move) of the camera (or an object for that matter). For example, if you want to move 8 units to the right and 4 to the front the matrix you set would look like this:
1 0 0 0
0 1 0 0
0 0 1 0
8 0 4 1
If you don''t rotate or scale, the 1 (one) values always remain.
Start with small values too, becourse a too great movement could move the object (or camera) out of your sight.
Try rotating only if you got the whole translation part covert.

Good luck

Dennis


visit my site, please:
members.nbci.com/dennis428/default.htm
visit my site, please:members.nbci.com/dennis428/default.htm
Trugath
Trugath
Ta man thx alot.

I understand it now.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.