<pyopengl 3.0.2>
<pyhton 2.7>
<wxpython 2.8.12.0> & <wxpython 3.0.0.0>
Hi !
I made a small change in NeHe's Lesson48.py file in Draw() function and made it look like this :
import numpy as np;
def Draw ():
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
NumpyDraw(); glFlush ();
glutSwapBuffers()
return;#array = np.array([[0.0, 0.0, 0.0], [1.0, 0, 0], [0.0, 1.0, 0]]);
#colNpArray = np.array([[255, 255, 255], [255, 0, 0], [0, 255, 0]], dtype=np.ubyte);
#print type(array), array
#print type(colNpArray), colNpArraydef NumpyDraw():
array = np.array([[0.0, 0.0, 0.0], [1.0, 0, 0], [0.0, 1.0, 0]]);
colNpArray = np.array([[255, 255, 255], [255, 0, 0], [0, 255, 0]], dtype=np.ubyte);glEnableClientState(GL_COLOR_ARRAY)
glEnableClientState(GL_VERTEX_ARRAY)glVertexPointer(3, GL_FLOAT, 0, array);
glColorPointer(3, GL_UNSIGNED_BYTE, 0, colNpArray)glDrawArrays( GL_LINE_STRIP, 0, len(array));
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);return;
This gave me a Red Horizontal line and Green Vertical line as a result (using glutCreateWindow, glutMainLoop).
<win7 32bit>, but it did gave a white horizontal line and a red vertical line on other 4-PC’c all being win7 32-bit
except for one 64-bit.
<pyopengl 3.0.2>
<pyhton 2.7>
<wxpython 2.8.12.0>
When tried with 3.0.0.0 it gave a line with two colours merging rightin the centre on the line.
<pyopengl 3.0.2>
<pyhton 2.7>
<wxpython 3.0.0.0>
I expected consistency as my next try would be ‘object picking’ using glReadPixel with hundreds of unique colours and
objects.
Also how is this suppose to work, I want one colour line how can I achieve it ?
-Rushabh