Concenring the high CPU usage after some thought and a test, it is mainly due to the while loop in which the OpenGL code run.


Le 07/14/10 14:19, Roland Everaert a écrit :

Its me again still playing with vertex array.

Using the code showed previously, I have tried to display a plane of 60 rows and 44 columns. With lighting disabled, no material properties defined and no normals provided, the rendering of such plane is performed at 10 FPS.

In addition, one of the core of the CPU is used at 100% by python what ever the size of the plane or the number of "objects" rendered.

Is it normal that python uses so much CPU?

Does 60 * 44 * 4, hence, 10560 vertices such big for an interactive application or should I use other techniques (VBO maybe) to render such amount of vertices or less vertices for such object? (I know that it depends, mainly, on what I want to do with the plane)

When using glGetString() to get information on the hardware here are the information I got:

NVIDIA Corporation
GeForce 8800 GTX/PCI/SSE2
3.2.0 NVIDIA 190.42

So it seems that the program is using the graphics card at some point.

The CPU of the machine is an AMD 64 X2 DualCore 5200+.

Thanks for any advise,


Le 07/14/10 11:49, Roland Everaert a écrit :

With glDrawArrays it works, I had anyway to change the example from:



glDrawArrays(GL_QUADS,0,len(self.vertices) / 3)



Le 07/13/10 23:48, Alejandro Segovia a écrit :
Hi Roland,

I completely agree with Ian on this one. glDrawArrays seems more appropriate for the way you are composing your arrays. IMO, this should not be setting any constraints on how many vertices you can supply to the GL tough. 

How much RAM does your video card have?


On Tue, Jul 13, 2010 at 1:22 PM, Ian Mallett <> wrote:
My recommendation: use glDrawArrays(...).


self.vertices = []
self.normals = []
self.nbrindices = 0
unit = 1.0
y = 0.0
rows = 2
columns = 8
z_center_delta = unit * (float(rows) / 2.0)
x_center_delta = unit * (float(columns) / 2.0)
for i in range(rows):
    delta_z = (unit * float(i)) - z_center_delta
    for j in range(columns):
        delta_x = (unit * float(j)) - x_center_delta
        self.vertices += [[0.0 + delta_x, y, 0.0 + delta_z],
                          [0.0 + delta_x, y, unit + delta_z],
                          [unit + delta_x, y, unit + delta_z],
                          [unit + delta_x, y, 0.0 + delta_z]]
        self.normals += [[0.0, +1.0, 0.0],
                         [0.0, +1.0, 0.0],
                         [0.0, +1.0, 0.0],
                         [0.0, +1.0, 0.0]]



glVertexPointer(3, GL_FLOAT, 0, self.vertices) # Specify the vertex list to be used to draw the object
glNormalPointer(GL_FLOAT, 0, self.normals) # Specify the normals list to be used to draw the object




This email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit --
PyOpenGL Homepage
PyOpenGL-Users mailing list

Alejandro Segovia Azapian
Director, Algorithmia: Visualization & Acceleration