Archived

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

glFustrum

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

glFrustum(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble near, GLdouble far)

gluPerspective(GLdouble fov, GLdouble aspect, GLdouble near, GLdouble far)

the difference is that with glPerspective you are defining the angle in Y that is visible, aspect is the width/height.glFrustum lets you specify asymetrical frustum(not good). I would not use frustum.

Share this post


Link to post
Share on other sites
Well I just want to achieve the same result as gluPerspective without having to use GLU.... (just GL), and i''ve been playing with glFustrum, but doesnt seem to be working how I want it :/ Any other ways?

Share this post


Link to post
Share on other sites

  
void my_gluPerspective(double FOV, double Aspect, double Near, double Far) {
double YMax = Near * tan(FOV * 0.5 * 0.01745329251994329);
double YMin = -YMax;
double XMin = YMin * Aspect;
double XMax = YMax * Aspect;

glFrustum(XMin,XMax,YMin,YMax,Near,Far);
}


Share this post


Link to post
Share on other sites
quote:
Original post by djdynamic
Thanks very much! That''s working wonderfully I''m just wondering how you came up with that code

Try looking in MesaGL''s (a.k.a. Mesa3D; an open source OpenGL implementation) source code, they have a GLU implementation included.

Share this post


Link to post
Share on other sites