• ### What is your GameDev Story?

#### Archived

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

# orthogonal projection (D3D)

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

## 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 on other sites
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 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 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 17
• 14
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634094
• Total Posts
3015498
×