On Fri, Dec 9, 2011 at 4:43 PM, Alfonso de la Osa <life@...> wrote:
> 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:
> this is the code:
> # draw_body
> def draw_body(body):
> """Draw an ODE body.
> x,y,z = body.getPosition()
> R = body.getRotation()
> rot = [R, R, R, 0.,
> R, R, R, 0.,
> R, R, R, 0.,
> x, y, z, 1.0]
> if body.shape=="box":
> sx,sy,sz = body.boxsize
> glScalef(sx, sy, sz)
> elif body.shape=="sphere":
> glutSolidSphere(body.radius, 10, 10)
> What can I do to solve this?
> Thank you in advance,
The problem is not in the code presented. If it's just the straight test,
I can vouch for its correctness, so the problem lies outside the code. Has
the code been modified from the sample?
It looks like depth testing is disabled--or maybe there's no depth buffer
in the first place. Make sure there's NOT a "glDisable(GL_DEPTH_TEST)"
anywhere. As I recall, the sample is based on PyGame. You might have to
explicitly request a depth buffer (i.e.,
"pygame.display.gl_set_attribute(GL_DEPTH_SIZE,8)" xor 16, 24, xor 32).
If the code is just the sample code, the problem is almost certainly your
GPU. Intel (graphics) chipsets just plain suck. Everyone in the graphics
industry knows this. Including Intel. They have dodgy hardware support at
best. In my tests, some chips don't even support OpenGL core specification
that's been in place for more than a decade.
That said, the internet has some suggestions. For instance, perhaps