Advertisement

Direct3D view matrix

Started by March 19, 2000 07:43 AM
0 comments, last by altair734 24 years, 11 months ago
I just got D3D to work (and it''s pretty cool) but there is one thing I can''t do: I''ve been using the view matrix for rotating the screen and the world coords for translating but for some reason when I rotate instead of rotating on the origin it moves around the viewpoint. Does anyone have a suggestion for this? altair altair734@yahoo.com biggins.mit.edu/altair734
altairaltair734@yahoo.comwww.geocities.com/altair734
you have to do rotation first, then translation. in your example just switch the world and view matrices. of course, the best way to handle the transformations is combine the camera''s rotation and translation matrices into one like:

D3DMath_MatrixMultiply( matView, matTrans, matRot )

so using matView as view matrix combines the camera position and rotation into a single view matrix to be set as the view matrix and leave the world matrix = identity matrix (for now).

hope this helps,
crazy166

some people think i'm crazy, some people know it

This topic is closed to new replies.

Advertisement