PDA

View Full Version : perspective GUI frustum



ugluk
11-28-2012, 08:59 PM
I was thinking about constructing the following perspective frustum:

l = - w / 2
r = w / 2
t = h / 2
b = - h / 2

n = w / (2 * tan(HFOV / 2)), f at infinity

with HFOV = 90 degrees, n = w / 2, usually rather large

Where w is the width and h is the height of the current viewport. But I am not entirely certain if this is a good idea? I don't want to sacrifice the ability to zoom in/out that an orthogonal projection would cause. But maybe such a frustum has some undesirable properties I am yet unaware of? I suppose the most significant problem would be that the frustum depends on the viewport dimensions, making z values of GUI elements non-constant.