simple app, hidden surface removal glitches

25 views
Skip to first unread message

Gabriele Lanaro

unread,
Feb 10, 2012, 11:38:17 AM2/10/12
to pyglet...@googlegroups.com
Hi! I'm trying to write a molecular viewer with pyglet. I've already developed a prototype with GLUT, which is working fine. I've ported the same code on pyglet but the result is that I have hidden surface removal issues. See the picture to understand what I mean. The cylinder should be displayed as they were inside of the sphere. As an additional information, if I try with the  wxpython opengl context I have the exact same problem.

The initialization code (the drawing take place in a subclass) is in this pastebin: http://pastebin.com/E5dwYke7

Did you ever had a problem with hidden surface removal? How to make it work correctly?


Tristam MacDonald

unread,
Feb 11, 2012, 12:07:44 PM2/11/12
to pyglet...@googlegroups.com
Try enabling depth testing.
--
Tristam MacDonald
System Administrator, Suffolk University Math & CS Department

Gary Herron

unread,
Feb 11, 2012, 12:18:26 PM2/11/12
to pyglet...@googlegroups.com
It looks like you don't have depth testing on. 

Make sure you have a depth buffer bu including a config parameter in the pyglet.window.Window.__init__ call
      config=Config(depth_size=24, ...)

AND that depth testing is on:
        glEnable(GL_DEPTH_TEST)
--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyglet-users/-/z4ZQg1noDR4J.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.

Gabriele Lanaro

unread,
Feb 11, 2012, 12:40:55 PM2/11/12
to pyglet...@googlegroups.com
Thank you! Yes, enabling depth testing makes things work.
Reply all
Reply to author
Forward
0 new messages