My bad, I was pasting code a little too quickly, as I have been re-
editing the file back and forth between demos that work and other
things that do not.

So just delete the glBegin(GL_TRIANGLES). I still can't get any
spheres. Even when I just paste the two lines into a working program.

On Mar 1, 8:38 pm, "Drew Smathers" <[EMAIL PROTECTED]> wrote:
> On Sat, Mar 1, 2008 at 6:48 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >  > Please post your code.
>
> >  >     Richard
>
> >  Sure thing. The short of it is that I'm doing something like
>
> >     sphere = gluNewQuadric()
> >     gluSphere(sphere,10.0,10,10)
>
> >  and the code crashes when I do the second step.
>
> >  But here's the code. It's a slight mod of one of the nehe demos.
>
> >  from pyglet import window
> >  from pyglet.gl import *
> >  from pyglet.gl.glu import *
> >  import pyglet.clock
>
> >  def resize(width, height):
> >     if height==0:
> >         height=1
> >     glViewport(0, 0, width, height)
> >     glMatrixMode(GL_PROJECTION)
> >     glLoadIdentity()
> >     gluPerspective(45, 1.0*width/height, 0.1, 100.0)
> >     glMatrixMode(GL_MODELVIEW)
> >     glLoadIdentity()
>
> >  def init():
> >     glShadeModel(GL_SMOOTH)
> >     glClearColor(0.0, 0.0, 0.0, 0.0)
> >     glClearDepth(1.0)
> >     glEnable(GL_DEPTH_TEST)
> >     glDepthFunc(GL_LEQUAL)
> >     glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
>
> >  def draw():
> >     glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
> >     glLoadIdentity()
>
> >     glBegin(GL_TRIANGLES)
> >     sphere = gluNewQuadric()
> >     gluSphere(sphere,10.0,10,10)
>
> Why are you calling glBegin(GL_TRIANGLES)?  In addition to posting
> code, you should also post a stacktrace to explain your crash.
> Anyhow, just glancing at the code, I imagine the explosion is due to
> calling glBegin(...) without a corresponding glEnd() .. or calling
> gluSpehere in the context of glBegin(GL_TRIANGLES).
>
> Regards,
> --
> \\\\\/\"/\\\\\\\\\\\
> \\\\/ // //\/\\\\\\\
> \\\/  \\// /\ \/\\\\
> \\/ /\/ / /\/ /\ \\\
> \/ / /\/ /\  /\\\ \\
> / /\\\  /\\\ \\\\\/\
> \/\\\\\/\\\\\/\\\\\\
>                d.p.s
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to