• Advertisement

Archived

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

orthogonal projection (D3D)

This topic is 6250 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

Well, basically what I need is the matrix values for a ortho. matrix. If I had a width, height, near z plane, far z plane, -> what''s the matrix? (Or even better whats the function? ) Oh yeah, I can''t use D3DX* funcs. because I use Borland C++Builder. Sorry! Thanxs in advance, C++Freak ------------------------------ BCB DX Library - RAD C++ Game development for BCB

Share this post


Link to post
Share on other sites
Advertisement
width is the width of the screen. Height is the height of the screen. near z is however close something has to be before it is behind the viewer. Far clipping plane is how far away something has to be before it is out of sight.



Just because you're outnumbered doesn't mean you're wrong.


sharewaregames.20m.com

Edited by - furby100 on January 11, 2001 12:34:01 PM

Share this post


Link to post
Share on other sites
quote:

width is the width of the screen. Height is the height of the screen. near z is however close
something has to be before it is behind the viewer. Far clipping plane is how far away
something has to be before it is out of site.


I get that!
But whats the matrix? i.e. is it
[1 0 0 0]
[0 1 0 0]
[0 0 0 0]
[0 0 0 1]
(I think this drops the z coordinate, am I right)?
If it is right, do I translate by -width/2, -height/2, 0 or what?
And what do I scale by?


------------------------------
BCB DX Library - RAD C++ Game development for BCB

Share this post


Link to post
Share on other sites
It translates it screen_res_width/2 and screen_res_height/2 (if you think about it, this must be correct). scalex = width/screen_res_width; scaley = height/screen_res_height

You could make it throw away the Z coordinate, but what happens in D3D is:
z = z/(farzplane - nearzplane)

This makes z between 0.0 and 1.0, and makes most efficient use of the Z-Buffer. And RHW is set to 1



Just because you''re outnumbered doesn''t mean you''re wrong.


sharewaregames.20m.com

Share this post


Link to post
Share on other sites

  • Advertisement