normals shown flipped sometimes

Alfonso de la Osa <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <CAFhV7UGJ6QY=7E29ntMNcodLLLj-_=jvr+fnVOmkuZi7TxeCmA@mail.gmail.com>
Hi,

I'm having troubles rendering with pyopengl (or glut)
running on Ubuntu 11.04, Intel GM965/GL960
when trying to render a glut solid box or glut solid sphere

I tried the pyode test and the boxes were wrong.
The faces seem to be invisible sometimes and the render don't show
objects ordered properly in depth, the normals sometimes flipped.
Then I added spheres and they were erroneously represented too.

I've taken 2 screenshots:

http://imgur.com/a/JBm8u

this is the code:

# draw_body
def draw_body(body):
    """Draw an ODE body.
    """

    x,y,z = body.getPosition()
    R = body.getRotation()
    rot = [R[0], R[3], R[6], 0.,
           R[1], R[4], R[7], 0.,
           R[2], R[5], R[8], 0.,
           x, y, z, 1.0]
    glPushMatrix()
    glMultMatrixd(rot)
    if body.shape=="box":

        glShadeModel(GL_FLAT)
        sx,sy,sz = body.boxsize
        glScalef(sx, sy, sz)
        glutSolidCube(1)
    elif body.shape=="sphere":

        glShadeModel(GL_FLAT)
        glutSolidSphere(body.radius, 10, 10)
    glPopMatrix()

What can I do to solve this?

Thank you in advance,

Alf.

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/

_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.