Advertisement

D3DUtil_SetProjectionMatrix

Started by March 11, 2000 10:28 PM
0 comments, last by crazy166 25 years ago
how does this work? i can never get a projection matrix created with this function to work. i always get "Illegal instructions". i set params like so: D3DUtil_SPM( mat, 1.57f, 1.0f, 0.5f, 1000.0f ); then try to draw a single 4-sided poly. sometimes (if i get the camera placement right), i get some wierd star shaped object that rapidly changes as view moves, then "Illegal Instruction" and crash. i think some of my (x,y,z)''s are invalid values that cause crash, but unless i want to step through my code 100,000 times i won''t know their values just before crash. i''ve read many articles and books on perspective transformations and have found over a dozen matrices that say they work. i haven''t gotten any to work. can you think of anything else i may be doing wrong? orthographic projections work fine (as do all rotation and translation matrices). thanx much, crazy166
You may want to use D3DXMatrixPerspectiveFov() instead. Almost everything that Microsoft does with the sample framework is supported by D3DX.

Above suggestion probably won''t fix your problem though, as the function does the exact same thing. The only thing I can think of right now is that you have used the projection matrices wrong. Especially if you use information on how to do projection with OpenGL you must transpose the matrix before using it in D3D. (This has to do with the fact that matrix multiplication is not commutative)

This topic is closed to new replies.

Advertisement