Advertisement

glFustrum

Started by November 19, 2002 01:45 AM
4 comments, last by djdynamic 22 years, 3 months ago
Anyone know how to use glFustrum as opposed to having to use gluPerspective. Thanks.
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.
Advertisement
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?

  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);}  


Thanks very much! That''s working wonderfully I''m just wondering how you came up with that code
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.

This topic is closed to new replies.

Advertisement