[PySide] total n00b question about hellogl geometry hookup

Dave Curtis davecurtis at sonic.net
Mon Nov 12 07:02:01 CET 2012


I am a total n00b with OpenGL, and still very new to Qt/pyside as well, 
so this question is very basic, but every time I dive into the 
documentation I go down a rabbit hole and get lost in the sheer mass of it.

I am trying to modify the hellogl.py example found here:

My geometry is coming from a new Python module called pyPolyCSG
which does constructive solid geometry.

My goal is to create a mesh using pyPolyCSG, and render that in place of 
the Qt logo in the hellogl example.  pyPolyCSG has these methods for 
extracting geometry:

obj.get_vertices() - returns vertex coordinates as a 2D numpy array
obj.get_triangles() - temporarily triangulates the mesh and returns a 2D 
numpy array of triangle vertex ids

and so I have gotten as far as creating nice numpy arrays of vertices 
and triangles of the object I want to render.  And of course, I can 
easily gut out the Qt logo construction code from hellogl.py :)  My 
problem is that I just can't seem to connect the dots here... given that 
I have a nice batch of vertices and triangles, how can I get that hooked 
up to OpenGL rendering?


More information about the PySide mailing list