1 to 1 screen mapping (D3D8)

Started by
0 comments, last by zedzeek 23 years, 1 month ago
i cant seem to see this in the documentation how to setup the model + view matrices so i have an orthogonal viewpoint (ie non perspective) with a one to one mapping ie (0,0) maps to the lowerleft + (windowwidth,winheight) maps to the upper right ps without using the D3DX libraries http://members.xoom.com/myBollux
Advertisement
Just set the projection matrix to something like

1
--------- 0 0 0
ScreenWidth

1
0 --------- 0 0
ScreenHeight


0 0 Q 1



0 0 -QZn 0


with Q = Zf/(Zf-Zn)
and
Zf = far clipping plane
Zn = near clipping plane

That is assuming you still want to do z-buffering.



Hmmm... that didn't show up too well.

It's
A 0 0 0
0 B 0 0
0 0 C 1
0 0 D 0

where
A = (1 / ScreenWidth)
B = (1 / ScreenHeight)
C = Q
D = -QZn

Edited by - ludemann8 on March 19, 2001 10:10:23 AM

This topic is closed to new replies.

Advertisement