Hello! I am trying out pyglet, and I would like to draw a sphere.

Here's some code that I'm trying to use right now:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math
from pyglet.gl import *

class Viewer:
    """Display self-organizing map."""
    def __init__(self, n_neurons):
        self.window = pyglet.window.Window(640, 480)
        self.n_neurons = n_neurons
        self.window.push_handlers(self)

    def on_draw(self):
        """Continuously updated."""
        glClear(GL_COLOR_BUFFER_BIT)
        glLoadIdentity()

        sphere = gluNewQuadric()
        gluSphere(sphere, 1.0, 100, 100)

if __name__ == "__main__":
    v = Viewer(10)
    pyglet.app.run()

It shows a black background, but without any sphere. I am able to draw
other
primitive creatures though, such as GL_LINES_LOOP etc.

--~--~---------~--~----~------------~-------~--~----~
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