[PyOpenGL-Users] how to use array with glsl ?
Brought to you by:
mcfletch
From: <con...@ce...> - 2007-02-21 13:09:09
|
Hello, is there a new way to use arrays, or is the following a bug. this code used to work with pyopengl2: kernel =3D [ 1, 4, 7, 4, 1, 4, 16, 26, 16, 4, 7, 26, 41, 26, 7, 4, 16, 26, 16, 4, 1, 4, 7, 4, 1, ]) for i in range(0,boxsize): kernel[i] /=3D 273. glUniform1fvARB(loc, boxsize, kernel) but with opengl-ctypes I get: ValueError: ('Expected 1 item array, got 25 item array', array=20 ([ 0.003663 , 0.01465201, 0.02564103, 0.01465201, 0.003663 , 0.01465201, 0.05860806, 0.0952381 , 0.05860806, 0.01465201, 0.02564103, 0.0952381 , 0.15018316, 0.0952381 , 0.02564103, 0.01465201, 0.05860806, 0.0952381 , 0.05860806, 0.01465201, 0.003663 , 0.01465201, 0.02564103, 0.01465201, =20 0.003663 ], dtype=3Dfloat32)) I join the increminated program. This is on MacOSX 10.4, python 2.5, last opengl-ctypes. best regards, =EF=BF=BC -- St=C3=A9phane Conversy Ecole Nationale de l'Aviation Civile, Toulouse, France http://www.tls.cena.fr/~conversy enac: +33 5 62 17 40 19 dgac r&d: +33 5 62 25 96 48 |