PDA

View Full Version : cut frustum



arthas
03-07-2008, 03:11 AM
Hi! I need to resize the frustum in this particoular way:

http://img142.imageshack.us/img142/8822/immagine1cp1.th.jpg (http://img142.imageshack.us/my.php?image=immagine1cp1.jpg)

I was thinking to make something like this:

http://img214.imageshack.us/img214/3641/immagine2pq2.th.jpg (http://img214.imageshack.us/my.php?image=immagine2pq2.jpg)

but I don't know if is the best way to do it, and how calculate it.. probably using the function ReadPixels, but how can I calculate the correct left coordinates ?

oc2k1
03-07-2008, 06:39 AM
Maybee you are looking for glViewport(), custom clip planes or the scissor test?

dletozeun
03-08-2008, 02:38 PM
You can not do that with the standard glFrustum, glPerspective functions because near and far clipping planes have to be parallel to the framebuffer.

sqrt[-1]
03-08-2008, 05:31 PM
Perhaps this could be of some help?

http://www.terathon.com/code/oblique.php

http://www.terathon.com/gdc07_lengyel.ppt