• Advertisement

Archived

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

D3DUtil_SetProjectionMatrix

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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)

Share this post


Link to post
Share on other sites

  • Advertisement