Re: [PyOpenGL-Users] A big problem with glOrtho
Brought to you by:
mcfletch
|
From: projetmbc <pro...@cl...> - 2009-04-11 09:28:35
|
Thanks for the information. Finally the problem was another :-[ :
GL.glEnable(GL.GL_CULL_FACE)
Where there are mathematic ( from the OpenGL's point of view)
definitions of the different perspectives ?
Best regards and a great thanks for the help.
Christophe.
> Definitely recommend using a perspective matrix for your first OpenGL
> programs. I use this class for perspective:
>
> class glLibView3D():
> def __init__(self,rect,angle,near=0.1,far=1000.0):
> self.rect = list(rect)
> self.angle = angle
> self.near = near
> self.far = far
> def set_angle(self,value):
> self.angle = angle
> def set_near(self,value):
> self.near = value
> def set_far(self,value):
> self.far = value
> def set_view(self):
> glViewport(*self.rect)
> glMatrixMode(GL_PROJECTION)
> glLoadIdentity()
>
> gluPerspective(self.angle,float(self.rect[2])/float(self.rect[3]),\
> self.near,self.far)
> glMatrixMode(GL_MODELVIEW)
> glLoadIdentity()
>
> HTH,
> Ian
|