pyopengl-users Mailing List for PyOpenGL (Page 45)
Brought to you by:
mcfletch
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(81) |
Oct
(41) |
Nov
(55) |
Dec
(14) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(34) |
Feb
(3) |
Mar
(16) |
Apr
(5) |
May
(10) |
Jun
(13) |
Jul
(24) |
Aug
(14) |
Sep
(14) |
Oct
(9) |
Nov
(10) |
Dec
(16) |
| 2003 |
Jan
(25) |
Feb
(59) |
Mar
(9) |
Apr
(21) |
May
(54) |
Jun
(4) |
Jul
(16) |
Aug
(19) |
Sep
(19) |
Oct
(15) |
Nov
(13) |
Dec
(22) |
| 2004 |
Jan
(19) |
Feb
(8) |
Mar
(20) |
Apr
(16) |
May
(13) |
Jun
(18) |
Jul
(18) |
Aug
(14) |
Sep
(24) |
Oct
(47) |
Nov
(20) |
Dec
(10) |
| 2005 |
Jan
(23) |
Feb
(31) |
Mar
(11) |
Apr
(29) |
May
(18) |
Jun
(7) |
Jul
(11) |
Aug
(12) |
Sep
(8) |
Oct
(4) |
Nov
(11) |
Dec
(7) |
| 2006 |
Jan
(7) |
Feb
(8) |
Mar
(15) |
Apr
(3) |
May
(8) |
Jun
(25) |
Jul
(19) |
Aug
(3) |
Sep
(17) |
Oct
(27) |
Nov
(24) |
Dec
(9) |
| 2007 |
Jan
(6) |
Feb
(43) |
Mar
(33) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(8) |
Sep
(11) |
Oct
(22) |
Nov
(15) |
Dec
(18) |
| 2008 |
Jan
(14) |
Feb
(6) |
Mar
(6) |
Apr
(37) |
May
(13) |
Jun
(17) |
Jul
(22) |
Aug
(16) |
Sep
(14) |
Oct
(16) |
Nov
(29) |
Dec
(13) |
| 2009 |
Jan
(7) |
Feb
(25) |
Mar
(38) |
Apr
(57) |
May
(12) |
Jun
(32) |
Jul
(32) |
Aug
(35) |
Sep
(10) |
Oct
(28) |
Nov
(16) |
Dec
(49) |
| 2010 |
Jan
(57) |
Feb
(37) |
Mar
(22) |
Apr
(15) |
May
(45) |
Jun
(25) |
Jul
(32) |
Aug
(7) |
Sep
(13) |
Oct
(2) |
Nov
(11) |
Dec
(28) |
| 2011 |
Jan
(35) |
Feb
(39) |
Mar
|
Apr
(25) |
May
(32) |
Jun
(17) |
Jul
(29) |
Aug
(10) |
Sep
(26) |
Oct
(9) |
Nov
(28) |
Dec
(4) |
| 2012 |
Jan
(24) |
Feb
(47) |
Mar
(4) |
Apr
(8) |
May
(9) |
Jun
(6) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(28) |
Nov
(2) |
Dec
(2) |
| 2013 |
Jan
(11) |
Feb
(3) |
Mar
(4) |
Apr
(38) |
May
(15) |
Jun
(11) |
Jul
(15) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(3) |
Dec
(14) |
| 2014 |
Jan
(24) |
Feb
(31) |
Mar
(28) |
Apr
(16) |
May
(7) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(10) |
Oct
(2) |
Nov
|
Dec
|
| 2015 |
Jan
(6) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(19) |
Dec
|
| 2016 |
Jan
(6) |
Feb
(1) |
Mar
(7) |
Apr
|
May
(6) |
Jun
|
Jul
(3) |
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
| 2017 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
| 2018 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Gijs <in...@bs...> - 2009-12-03 16:10:36
|
Hello Timothée, You could try to use two textures instead of one. When you display one, you can write to the other and swap them and continue (also called the "ping-pong" technique). Another possibility is to use shaders to change your texture, but I'm not too sure if that is any faster. Also, since Python is actually quite slow when compared to languages like C, even OpenGL slows down considerably when used in Python. So if possible, push as much commands to display lists, vertex arrays, or VBOs. You can push all commands you use to draw the quad to a display list, which basically brings down the number of calls to one (since you only need to call the display list). Regards, Gijs PS: While it is not necessary, I would supply the glTexImage2D call, that you use to create the texture, an array with zeros the size of the texture. This way you know that the texture is zero everywhere. On 3-12-2009 15:19, Timothée Lecomte wrote: > Dear pyopengl users, > > I am writing (as a hobby) an application that does real-time > visualization of audio data. The main widget is a rolling spectrogram, > that is a colored image where the horizontal axis is the time, the > vertical axis is the frequency, and the color of each pixel represents > the intensity of the corresponding spectrum component (see > http://www.flickr.com/photos/41584197@N03/3832486029/in/set-72157622072708326/ > for example). Each column of the image is computed with a FFT of the > audio data every 20 ms or so, and the whole image is displayed on screen > and "rolls" and time goes by. > > I am trying to use OpenGL to improve the performance of the part of the > application that displays the image on the screen, but I can't manage to > get it really faster than a simple 2D blitting, so I am asking for your > help ! > > Currently, I first set up a texture with the following : > > # Create Texture > GL.glGenTextures(1, self.texture) # generate one texture name > GL.glBindTexture(GL.GL_TEXTURE_2D, self.texture) # bind a 2d > texture to the generated name > GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1) > GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, > 2*self.canvas_width, height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, None) > GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, > GL.GL_CLAMP) > GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, > GL.GL_CLAMP) > GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, > GL.GL_REPEAT) > GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, > GL.GL_REPEAT) > GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, > GL.GL_NEAREST) > GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, > GL.GL_NEAREST) > GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_DECAL) > > Then, every 20 ms or so, I modify two columns of that texture with : > GL.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, self.offset, 0, 1, > self.height, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, byteString) > GL.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, self.offset + > self.canvas_width, 0, 1, self.height, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, > byteString) > > And I draw part of that texture to my widget with : > GL.glLoadIdentity() > GL.glBegin(GL.GL_QUADS) > xoff = float(self.offset)/(2*self.canvas_width) > GL.glTexCoord2f(xoff, 0.) > GL.glVertex2f(0, 0) > GL.glTexCoord2f(1.+xoff , 0.) > GL.glVertex2f(2*self.canvas_width, 0) > GL.glTexCoord2f(1.+xoff, 1.) > GL.glVertex2f(2*self.canvas_width, self.height) > GL.glTexCoord2f(xoff, 1.) > GL.glVertex2f(0, self.height) > GL.glEnd() > > Profiling shows that the two GL.glTexSubImage2D take a lot of time (more > than twice as much as the whole drawing part) whereas it's "just" two > single columns of the texture being updated... What can I do to optimize > this ? Is there a smarter way to achieve the same result ? > > Thanks for your help ! > > Timothée Lecomte > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
|
From: Timothée L. <tim...@lp...> - 2009-12-03 14:21:50
|
Dear pyopengl users, I am writing (as a hobby) an application that does real-time visualization of audio data. The main widget is a rolling spectrogram, that is a colored image where the horizontal axis is the time, the vertical axis is the frequency, and the color of each pixel represents the intensity of the corresponding spectrum component (see http://www.flickr.com/photos/41584197@N03/3832486029/in/set-72157622072708326/ for example). Each column of the image is computed with a FFT of the audio data every 20 ms or so, and the whole image is displayed on screen and "rolls" and time goes by. I am trying to use OpenGL to improve the performance of the part of the application that displays the image on the screen, but I can't manage to get it really faster than a simple 2D blitting, so I am asking for your help ! Currently, I first set up a texture with the following : # Create Texture GL.glGenTextures(1, self.texture) # generate one texture name GL.glBindTexture(GL.GL_TEXTURE_2D, self.texture) # bind a 2d texture to the generated name GL.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1) GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, 2*self.canvas_width, height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, None) GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP) GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP) GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT) GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT) GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST) GL.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST) GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_DECAL) Then, every 20 ms or so, I modify two columns of that texture with : GL.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, self.offset, 0, 1, self.height, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, byteString) GL.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, self.offset + self.canvas_width, 0, 1, self.height, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, byteString) And I draw part of that texture to my widget with : GL.glLoadIdentity() GL.glBegin(GL.GL_QUADS) xoff = float(self.offset)/(2*self.canvas_width) GL.glTexCoord2f(xoff, 0.) GL.glVertex2f(0, 0) GL.glTexCoord2f(1.+xoff , 0.) GL.glVertex2f(2*self.canvas_width, 0) GL.glTexCoord2f(1.+xoff, 1.) GL.glVertex2f(2*self.canvas_width, self.height) GL.glTexCoord2f(xoff, 1.) GL.glVertex2f(0, self.height) GL.glEnd() Profiling shows that the two GL.glTexSubImage2D take a lot of time (more than twice as much as the whole drawing part) whereas it's "just" two single columns of the texture being updated... What can I do to optimize this ? Is there a smarter way to achieve the same result ? Thanks for your help ! Timothée Lecomte |
|
From: Jef M. <jef...@gm...> - 2009-11-11 19:14:41
|
newbie question: is it possible to calculate (or approximate) the COG (centre-of-gravity) and volume for a mesh model (e.g. as imported from an OBJ model) ? What would be the approach ? regards Jef |
|
From: Mike C. F. <mcf...@vr...> - 2009-11-11 17:55:47
|
I've just finished the 3.0.1b1 release of PyOpenGL. This release is
mostly just bug-fixes from the 3.0.1a4 release. There are fixes to
glGet and glGetActiveUniform, a script to retrieve and fixes to support
Togl binary installations, exposure of the OpenGL 3.2 entry points
(though largely untested, as I have no hardware over OpenGL 2.1),
missing AMD extensions, int64 array-types and fixes for boolean-array
handling. The documentation has had some work, including the
installation instructions.
OpenGLContext and PyVRML97 have also been rev'd and are now at 2.1.0a7
and 2.2.0a5 respectively. There's also an OpenGLContext PyQt4 context
(OpenGLContext_qt) and an OpenGLContext-full package that installs most
of the dependencies for OpenGLContext which are easy_installable.
Not intending anything other than bug-fixes before the 3.0.1 release for
PyOpenGL. OpenGLContext will likely have considerably more work before
it goes beta.
Enjoy yourselves,
Mike
The changelog for PyOpenGL is as follows:
316: Mike C. Fletcher 2009-11-10 {release-3.0.1b1} SF#2895081 more
constants added for glGet, basically everything...
315: Mike C. Fletcher 2009-11-10 Aborted attempt to introduce generic
defaulted parameters for wrappers...
314: Mike C. Fletcher 2009-11-10 SF#2895081 missing constants for glGet
registration added
313: Mike C. Fletcher 2009-11-10 Script to write the changelog, instead
of looking up parameters every time
312: Mike C. Fletcher 2009-11-10 Bump version for OpenGL_accelerate.
311: Mike C. Fletcher 2009-11-09 A partial import from the accelerator
module could cause a complete failure due t...
310: Mike C. Fletcher 2009-11-09 Eliminate error-suppression warning
when module cleanup happens before vbo cleanu...
309: Mike C. Fletcher 2009-11-09 Fix for gluProject on Ubuntu where
somehow ctypes returns a None instead of a GLi...
308: Mike C. Fletcher 2009-11-07 Add docstring to the Tk module to let
people know that they really should use som...
307: Mike C. Fletcher 2009-11-07 Tweaking and commenting togl download
script
306: Mike C. Fletcher 2009-11-07 Tk require is needed *before* Tk load
to get the Togl widget loaded...
305: Mike C. Fletcher 2009-11-07 Make bzrignore more generic
304: Mike C. Fletcher 2009-11-07 Add Togl license to the license.txt file.
303: Mike C. Fletcher 2009-11-07 Update the Togl installer to use modern
binary distributions and (hopefully) work...
302: Mike C. Fletcher 2009-11-07 Add test for gldouble return-arry type
registry
301: Mike C. Fletcher 2009-11-07 Fix formatting in a few modules.
300: Mike C. Fletcher 2009-11-07 Always register *only* instantiated
format handler plugins, never their classes.
299: Mike C. Fletcher 2009-11-07 References for constant were off and
need the accelerated version
298: Mike C. Fletcher 2009-11-07 Make the OpenGL 3.2 entry points
available in OpenGL.GL namespace
297: Mike C. Fletcher 2009-11-07 Regeneration with the fixed generator
to make array types match (mostly boolean a...
296: Mike C. Fletcher 2009-11-07 Missing AMD directory was preventing
getting the post-ATI-era extensions generated
295: Mike C. Fletcher 2009-11-07 Bump version for release this weekend...
294: Mike C. Fletcher 2009-11-07 Make int64 record-types available as
arrays and constants when possible
293: Mike C. Fletcher 2009-11-07 Make generation handle a few more
data-types, reduce logging level so that warnin...
292: Mike C. Fletcher 2009-11-07 SF#2844174 with error-checking enabled,
was passing status value into function (g...
291: Mike C. Fletcher 2009-11-07 SF#2882405 patch from Vickenty Fesunov
to fix glGetActiveUniform
290: Mike C. Fletcher 2009-11-07 Trigger mainloop in the glut init test.
289: Mike C. Fletcher 2009-10-01 Update docs to show proper types for
the shader source strings
288: Mike C. Fletcher 2009-10-01 Add some queries to display context values
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
|
|
From: Gijs <in...@bs...> - 2009-11-10 20:57:44
|
No problem :) On 10-11-2009 21:24, Mohan Ganesalingam wrote: > Dear Gijs, > > thank you so much! > > Mohan > > >> Hi Gijs, >> >> >>> I usually use Numpy arrays for calls like this. So something like this: >>> data = zeros(width*height, 'f')+0.5 >>> glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, >>> GL_LUMINANCE, GL_FLOAT, data) >>> >> Thanks for the suggestion! Unfortunately I'm still getting an error... >> I'm sure I'm doing something stupid, but would you mind taking a look at >> it? (I can post the complete source code as well, but it's>100 lines, so >> I'm not sure whether it's all right to send it to the list... ) >> >> thanks again, >> Mohan >> >> Error: >> >> Traceback (most recent call last): >> File "C:\Mohan\pygpu\test.py", line 110, in<module> >> glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, >> GL_LUMINAN CE, GL_FLOAT, data) >> File "C:\Program >> Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 1284, in >> __call__ >> return self.finalise()( *args, **named ) >> File "C:\Program >> Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 681, in >> wrapperCall >> raise err >> OpenGL.error.GLError: GLError( >> err = 1281, >> description = 'invalid value', >> baseOperation = glTexSubImage2D, >> pyArgs = ( >> GL_TEXTURE_RECTANGLE_ARB, >> 0, >> 0, >> 0, >> 512, >> 512, >> GL_LUMINANCE, >> GL_FLOAT, >> array([ 0.30000001, 0.30000001, 0.3..., >> ), >> cArgs = ( >> GL_TEXTURE_RECTANGLE_ARB, >> 0, >> 0, >> 0, >> 512, >> 512, >> GL_LUMINANCE, >> GL_FLOAT, >> array([ 0.30000001, 0.30000001, 0.3..., >> ), >> cArguments = ( >> GL_TEXTURE_RECTANGLE_ARB, >> 0, >> 0, >> 0, >> 512, >> 512, >> GL_LUMINANCE, >> GL_FLOAT, >> c_void_p(90243104), >> ) >> ) >> >> >> > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
|
From: Mohan G. <mg...@ca...> - 2009-11-10 20:24:39
|
Dear Gijs, thank you so much! Mohan >Hi Gijs, > >>I usually use Numpy arrays for calls like this. So something like this: >>data = zeros(width*height, 'f')+0.5 >>glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, >>GL_LUMINANCE, GL_FLOAT, data) > > Thanks for the suggestion! Unfortunately I'm still getting an error... > I'm sure I'm doing something stupid, but would you mind taking a look at > it? (I can post the complete source code as well, but it's >100 lines, so > I'm not sure whether it's all right to send it to the list... ) > >thanks again, >Mohan > >Error: > >Traceback (most recent call last): > File "C:\Mohan\pygpu\test.py", line 110, in <module> > glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, >GL_LUMINAN CE, GL_FLOAT, data) > File "C:\Program >Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 1284, in >__call__ > return self.finalise()( *args, **named ) > File "C:\Program >Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 681, in >wrapperCall > raise err >OpenGL.error.GLError: GLError( > err = 1281, > description = 'invalid value', > baseOperation = glTexSubImage2D, > pyArgs = ( > GL_TEXTURE_RECTANGLE_ARB, > 0, > 0, > 0, > 512, > 512, > GL_LUMINANCE, > GL_FLOAT, > array([ 0.30000001, 0.30000001, 0.3..., > ), > cArgs = ( > GL_TEXTURE_RECTANGLE_ARB, > 0, > 0, > 0, > 512, > 512, > GL_LUMINANCE, > GL_FLOAT, > array([ 0.30000001, 0.30000001, 0.3..., > ), > cArguments = ( > GL_TEXTURE_RECTANGLE_ARB, > 0, > 0, > 0, > 512, > 512, > GL_LUMINANCE, > GL_FLOAT, > c_void_p(90243104), > ) >) > > |
|
From: Gijs <in...@bs...> - 2009-11-10 19:52:01
|
On 11/10/09 19:15 , Mohan Ganesalingam wrote: > Hi Gijs, > > >> I usually use Numpy arrays for calls like this. So something like this: >> data = zeros(width*height, 'f')+0.5 >> glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, >> GL_LUMINANCE, GL_FLOAT, data) >> > Thanks for the suggestion! Unfortunately I'm still getting an error... I'm > sure I'm doing something stupid, but would you mind taking a look at it? (I > can post the complete source code as well, but it's>100 lines, so I'm not > sure whether it's all right to send it to the list... ) > > thanks again, > Mohan > > Error: > > Traceback (most recent call last): > File "C:\Mohan\pygpu\test.py", line 110, in<module> > glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, > GL_LUMINAN CE, GL_FLOAT, data) > File "C:\Program > Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 1284, in > __call__ > return self.finalise()( *args, **named ) > File "C:\Program > Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 681, in > wrapperCall > raise err > OpenGL.error.GLError: GLError( > err = 1281, > description = 'invalid value', > baseOperation = glTexSubImage2D, > pyArgs = ( > GL_TEXTURE_RECTANGLE_ARB, > 0, > 0, > 0, > 512, > 512, > GL_LUMINANCE, > GL_FLOAT, > array([ 0.30000001, 0.30000001, 0.3..., > ), > cArgs = ( > GL_TEXTURE_RECTANGLE_ARB, > 0, > 0, > 0, > 512, > 512, > GL_LUMINANCE, > GL_FLOAT, > array([ 0.30000001, 0.30000001, 0.3..., > ), > cArguments = ( > GL_TEXTURE_RECTANGLE_ARB, > 0, > 0, > 0, > 512, > 512, > GL_LUMINANCE, > GL_FLOAT, > c_void_p(90243104), > ) > ) > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > After reviewing your code it appeared that you didn't first set the texture format/width/height/etc, using glTexImage2D. You first have to define this before you do something with it, for instance call glTexSubImage2D on it. This can be done using the following code: glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_FLOAT, zeros(width*height, 'f')) Regards, Gijs |
|
From: Mohan G. <mg...@ca...> - 2009-11-10 18:16:13
|
Hi Gijs,
>I usually use Numpy arrays for calls like this. So something like this:
>data = zeros(width*height, 'f')+0.5
>glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height,
>GL_LUMINANCE, GL_FLOAT, data)
Thanks for the suggestion! Unfortunately I'm still getting an error... I'm
sure I'm doing something stupid, but would you mind taking a look at it? (I
can post the complete source code as well, but it's >100 lines, so I'm not
sure whether it's all right to send it to the list... )
thanks again,
Mohan
Error:
Traceback (most recent call last):
File "C:\Mohan\pygpu\test.py", line 110, in <module>
glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height,
GL_LUMINAN CE, GL_FLOAT, data)
File "C:\Program
Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 1284, in
__call__
return self.finalise()( *args, **named )
File "C:\Program
Files\_Coding\Python26\lib\site-packages\OpenGL\wrapper.py", line 681, in
wrapperCall
raise err
OpenGL.error.GLError: GLError(
err = 1281,
description = 'invalid value',
baseOperation = glTexSubImage2D,
pyArgs = (
GL_TEXTURE_RECTANGLE_ARB,
0,
0,
0,
512,
512,
GL_LUMINANCE,
GL_FLOAT,
array([ 0.30000001, 0.30000001, 0.3...,
),
cArgs = (
GL_TEXTURE_RECTANGLE_ARB,
0,
0,
0,
512,
512,
GL_LUMINANCE,
GL_FLOAT,
array([ 0.30000001, 0.30000001, 0.3...,
),
cArguments = (
GL_TEXTURE_RECTANGLE_ARB,
0,
0,
0,
512,
512,
GL_LUMINANCE,
GL_FLOAT,
c_void_p(90243104),
)
)
|
|
From: Gijs <in...@bs...> - 2009-11-10 17:41:50
|
On 10-11-2009 18:07, Mohan Ganesalingam wrote: > Hi, > > I'm trying to port some very elementary GPGPU code (based on > http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html) to run > with Python(+PyOpenGL+pygame). I'm running into some difficulties > translating the following line... > > glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, > GL_LUMINANCE, GL_FLOAT, data) > > I think the problem is that I don't have 'data' in the right format. (I've > tried several things, including arrays and strings. In the original C code > it's just a float*.) Would anyone be able to tell me what the appropriate > format in Python would be? > > Thank you in advance, > Mohan > Hi Mohan, I usually use Numpy arrays for calls like this. So something like this: data = zeros(width*height, 'f')+0.5 glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, GL_LUMINANCE, GL_FLOAT, data) This should give all your texels a value of 0.5. Regards, Gijs |
|
From: Mohan G. <mg...@ca...> - 2009-11-10 17:07:41
|
Hi, I'm trying to port some very elementary GPGPU code (based on http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html) to run with Python(+PyOpenGL+pygame). I'm running into some difficulties translating the following line... glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, width, height, GL_LUMINANCE, GL_FLOAT, data) I think the problem is that I don't have 'data' in the right format. (I've tried several things, including arrays and strings. In the original C code it's just a float*.) Would anyone be able to tell me what the appropriate format in Python would be? Thank you in advance, Mohan |
|
From: Jef M. <jef...@gm...> - 2009-11-10 09:01:57
|
I recently posted a request for help with freezing PyOpenGL programs with
cx_Freeze.
With the help from Dan Helfman and Mike C Fletcher, I was able to freeze my
PyOpenGL program with py2exe.
I have not tried this with cx_Freeze, but that will probably work similarly.
I'll describe here what I did to make it work, just in case it would help
someone out there.
In order to freeze PyOpenGL applications, you need to exclude the OpenGL
library from the freeze process
and add the library manually in the distributable directory.
In order to make this work, you need to tell your application where to go
look for the OpenGL module.
To do this, you need to insert the current directory . in front of the
sys.path search list.
1) make sure you have py2exe installed
2) in your main source file, include the following at the very top (before
all the includes):
import sys
sys.path.insert( 0, '.' )
3) create a file called setup.py in your source folder with the following
content:
from distutils.core import setup
import py2exe
setup(windows=[<yourprogramhere>.py'],
options={"py2exe": {"includes": ["ctypes", "logging"],
"excludes": ["OpenGL"],
}
}
)
note: not sure about ctypes and logging. You might need more.
3) on the command line in your source folder:
python setup.py py2exe
This creates a folder called dist.
4)
Examine the output of py2exe. In my case, it put out something like:
>The following modules appear to be missing
>['OpenGL.GL', 'OpenGL.GLU', 'OpenGL.GLUT', 'OpenGL.arrays.ctypesarrays',
'OpenGL.arrays.
ctypesparameters', 'OpenGL.arrays.ctypespointers', '
>OpenGL.arrays.lists', 'OpenGL.arrays.nones', 'OpenGL.arrays.numbers',
'OpenGL.arrays.strings', 'OpenGL.platform.win32',
'OpenGL.raw.GL<http://opengl.raw.gl/>',
'du
>mmy.Process', 'email.Generator', 'email.Iterators', 'numpy']
In your main Python source file, ensure you import most of the
OpenGL-related ones.
I ommitted the funny ones like 'dummy.Process', 'email.Generator',
'email.Iterators', 'numpy'. That didn't have an impact.
In my case, I put the following imports under the "import sys" described in
point 2.
In your case, some other OpenGL related modules might appear. You might want
to import those too.
import OpenGL.platform.win32
import OpenGL.arrays.ctypesarrays
import OpenGL.arrays.ctypesparameters
import OpenGL.arrays.ctypespointers
import OpenGL.arrays.lists
import OpenGL.arrays.nones
import OpenGL.arrays.numbers
import OpenGL.arrays.strings
import OpenGL.platform.win32
import OpenGL.raw.GL
#import dummy.Process
#import email.Generator
#import email.Iterators
#import numpy
import OpenGL.GL
import OpenGL.GLU
import OpenGL.GLUT
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
if you use numpy, you need the following too:
import OpenGL.arrays.numpymodule
5)
re-run py2exe (step 3)
6)
>From C:\Python26\Lib\site-packages, copy the folder OpenGL inside the newly
created dist folder.
You can delete the pyc and pyo files to reduce the footprint
On a side note:
Pyglet programs seem to be less cumbersome to freeze. I was able to freeze
them with cx_Freeze with only one minor modification
in the Pyglet code (comment out an offending import).
According to Mike, this is because Pyglet does not support plugins, which
makes the implementation simpler.
So, in case you really can't make it work under PyOpenGL, take a look at
Pyglet.
I almost made the step until I got it working as described above
Special thanks to Mike and Dan.
Hope this helps
Jef
|
|
From: Mike C. F. <mcf...@vr...> - 2009-11-10 03:17:05
|
Jef Mangelschots wrote: > I added: > > import OpenGL.arrays > import OpenGL.arrays.lists You'd need more than just those, the next error you see is the ctypes array plug-in, you'll also need the platform plugin. You can see all of the standard plugins in the OpenGL.__init__ module, here's what the imports would look like, assuming a Win32 platform is desired: import OpenGL.platform.win32 import OpenGL.arrays.nones import OpenGL.arrays.lists import OpenGL.arrays.strings import OpenGL.arrays.numbers import OpenGL.arrays.ctypesarrays import OpenGL.arrays.ctypesparameters import OpenGL.arrays.ctypespointers and if you use numpy: import OpenGL.arrays.numpymodule Keep in mind the caveat that the DLLs directory (which likely has your GLUT and GLE implementations) won't be picked up that way. HTH, Mike > However, that won't pick up the DLLS directory, which is where > GLUT and > GLE are installed. The "normal" path to py2exe-ing with PyOpenGL > is to > exclude the entire OpenGL directory and then add the unpacked > package to > your application's path. > > HTH, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
|
From: Mike C. F. <mcf...@vr...> - 2009-11-09 23:50:38
|
Jef Mangelschots wrote:
> in reference to a previous email I sent about glitInit() throwing an
> exception when run a frozen Python program on Windows 7, ...
>
> when I freeze and run the program on XP, I get the following exception
> thrown:
> I think I need to import something specific but can't figure out what:
> It runs fine in interpreted mode.
...
> ImportError: ('No module named lists',
> <OpenGL.converters.CallFuncPyConverter object at 0x00EFB730>)
You're missing the array-format plugins for lists (likely also for
arrays, strings, etceteras). You'll also likely be missing the platform
plugin. In OpenGL.__init__ you'll find the definitions for the standard
plug-ins, you can, if you like, import those modules explicitly in your
script.
However, that won't pick up the DLLS directory, which is where GLUT and
GLE are installed. The "normal" path to py2exe-ing with PyOpenGL is to
exclude the entire OpenGL directory and then add the unpacked package to
your application's path.
HTH,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
|
|
From: Dan H. <Dan...@no...> - 2009-11-09 19:32:32
|
Jef Mangelschots wrote:
> in reference to a previous email I sent about glitInit() throwing an
> exception when run a frozen Python program on Windows 7, ...
>
> when I freeze and run the program on XP, I get the following exception
> thrown:
> I think I need to import something specific but can't figure out what:
> It runs fine in interpreted mode.
[...]
> module = __import__( ".".join(moduleName), {}, {}, moduleName)
> ImportError: ('No module named lists',
> <OpenGL.converters.CallFuncPyConverter object at 0x00EFB730>)
>
>
> I have attached the source code.
> I am running the following software:
> Python 2.6.4
> PyOpenGL-3.0.1a3
> cx_Freeze-4.1.win32-py26
Hi Jef,
I'm using py2exe rather than cx_Freeze, but I had similar traceback when
trying to run my application frozen.
The only way I could get PyOpenGL working when frozen with py2exe is to
exclude the OpenGL module from the automatic dependency finder, and then
copy over the entire contents of the OpenGL directory during the
setup.py py2exe process.
For more info, see: http://www.py2exe.org/index.cgi/PyOpenGL
Dan
|
|
From: Jef M. <jef...@gm...> - 2009-11-09 09:12:16
|
When I run my test Python program interpreted, it runs fine.
When I freeze that same program with cx_Freeze, it throws the following
exception:
Traceback (most recent call last):
File "c:\python26\lib\site-packages\cx_Freeze\initscripts\Console.py",
line 27, in <module>
exec code in m.__dict__
File "bouncing.py", line 109, in <module>
glutInit(sys.argv)
File "c:\python26\lib\site-packages\OpenGL\GLUT\special.py", line 323, in
glutInit
_base_glutInit( ctypes.byref(count), holder )
TypeError: 'NoneType' object is not callable
This is the program:
import OpenGL.platform.win32
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import sys
glutInit(sys.argv)
I am using Windows 7
Has anyone seen this problem before ?
|
|
From: Mike C. F. <mcf...@vr...> - 2009-11-07 07:35:19
|
Richard Guercke wrote:
> Hi,
> I’d like to know what I am doing wrong.
> I want to transfer an array with vertices and another one with index data into buffers on the graphics card and use them in a drawElements(..) call.
> As a beginner with OpenGL (coming from Java3d), I am looking for an example that works with PyOpenGL. The C code that I have found on the Internet does not really help in this context because the problem is possibly my lack of understanding the PyOpenGL wrapping.
> Here is the code I tried:
>
There are a few convenience mechanisms in PyOpenGL, so your VBOs can be
defined like so:
from OpenGL.arrays import vbo
verts = vbo.VBO( array([[ 0,0,0 ], [ 9,0,0 ], [ 0,9,0 ], [ 0,0,9 ]],
dtype=float32) )
idxs = vbo.VBO( array([ 0,1, 0,2, 0,3],dtype=ubyte),
target=GL_ELEMENT_ARRAY_BUFFER )
verts.bind()
glEnableClientState(GL_VERTEX_ARRAY)
glVertexPointer(..., verts )
idxs.bind()
glDrawElements( ..., idxs )
the 0's in your calls are getting converted to 1-element arrays of
ints. A ctypes.c_void_p( 0 ) should work fine, if you don't want to use
a vbo object.
HTH,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
|
|
From: Richard G. <rgu...@gm...> - 2009-11-06 17:01:11
|
Hi,
I’d like to know what I am doing wrong.
I want to transfer an array with vertices and another one with index data into buffers on the graphics card and use them in a drawElements(..) call.
As a beginner with OpenGL (coming from Java3d), I am looking for an example that works with PyOpenGL. The C code that I have found on the Internet does not really help in this context because the problem is possibly my lack of understanding the PyOpenGL wrapping.
Here is the code I tried:
class Widget3D:
…
def On_init( … ):
…
# initialize data: just a small coordinates frame for use with GL_LINES
verts=array([[ 0,0,0 ], [ 9,0,0 ], [ 0,9,0 ], [ 0,0,9 ]], dtype=float32)
idxs = array([ 0,1, 0,2, 0,3],dtype=ubyte)
# initialize buffers
bf=glGenBuffers(1)
glEnableClientState(GL_VERTEX_ARRAY)
usage = GL_DYNAMIC_DRAW
glBindBuffer(GL_ARRAY_BUFFER, bf)
glBufferData(GL_ARRAY_BUFFER, verts, usage)
glBindBuffer(GL_ARRAY_BUFFER, 0)
# I know I should store the size and type of the data as well; for the test I just insert the values in the rendering call because I know them
self.bf=bf
ibf = glGenBuffers(1)
usage = GL_DYNAMIC_DRAW
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibf)
glBufferData(GL_ELEMENT_ARRAY_BUFFER, idxs, usage)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0)
self.ibf=ibf
# Method called for each redraw
def drawGL(…):
glBindBuffer(GL_ARRAY_BUFFER, self.bf)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, self.ibf)
glEnableClientState(GL_VERTEX_ARRAY)
# This line is needed to make drawArrays(…) work but may be harmful in context of Index buffer
glVertexPointer(3,GL_FLOAT,0,None)
# perhaps the last argument should not be 0; I tried None but does not work either
# possibly I should use something connected with c_void_ptr but I dont know the syntax
glDrawElements(GL_LINES,6, GL_UNSIGNED_BYTE,0)
# the following line works fine (if I do not bind the index buffer) which makes me suspect it has something to do with the index buffer
# a reading mapBuffer(…) call gives the right content for the index buffer, so the data transfer to the card worked
# glDrawElementsui(GL_LINES, [0,1,0,2,0,3])
I am using the OpenGL code in a PyQt QGLWidget subclass; perhaps the issue comes from there.
Usually, the application just crashes if I try to execute the code.
Please help me to find the right way of convincing PyOpenGL to draw my arrays.
Thanks
Richard
--
DSL-Preisknaller: DSL Komplettpakete von GMX schon für
16,99 Euro mtl.!* Hier klicken: http://portal.gmx.net/de/go/dsl02
|
|
From: Mads I. <mp...@co...> - 2009-10-31 08:34:18
|
Calculate the size of the bounding box that enclose all your objects. Then make sure the bounding box fits your scene. For a good discussion on the topic, read the section 'Troubleshooting Transformations' http://www.glprogramming.com/red/chapter03.html Best regards, Mads Tim Smith (25121) wrote: > > Sorry to pester everyone with so many questions, > > I’m creating a large object with the intention of zooming around and > rotating around it, but I’d like to zoom out initially enough to fit > the object to screen, I can’t seem to get this to work? > > I need to calculate the end size of the object and then set the camera > accordingly right? > > ********************************************************************** > IMPORTANT - This email and any attachments may contain confidential or > privileged information intended solely for the intended recipient and > / or copyrighted material. If you are not the intended recipient you > must not use, interfere with, disclose, copy or take any action with > reliance on this email or any part of it. If you have received this > email in error please advise the sender via return email and delete or > destroy all copies of this email and attachments. Any claim to > confidentiality or privilege is not waived or lost by reason of > mistaken transmission of this message. Any unauthorised use, copying > or distribution is prohibited. Minara Resources Limited does not > warrant that this email or any attachments are free of viruses and > cannot guarantee the accuracy, reliability or completeness of this > email and any attachments. > > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > > www.clearswift.com <http://www.clearswift.com/> > ********************************************************************** > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > -- +-------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +-------------------------------+-----------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Nørre Søgade 27A | www: www.quantumwise.com | | DK-1370 Copenhagen K, Denmark | email: mp...@qu... | +-------------------------------+-----------------------------+ |
|
From: Mads I. <mp...@co...> - 2009-10-31 08:25:35
|
and use numpy for holding and managing your data. Mads Ian Mallett wrote: > PyOpenGL can handle large datasets, yes. I would recommend a vertex > buffer object, or display list. > > As for mouse movement, you can use OpenGL.GLUT somehow, or other > packages like PyGame. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > ------------------------------------------------------------------------ > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > -- +-------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +-------------------------------+-----------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Nørre Søgade 27A | www: www.quantumwise.com | | DK-1370 Copenhagen K, Denmark | email: mp...@qu... | +-------------------------------+-----------------------------+ |
|
From: Tim S. (25121) <tk...@mi...> - 2009-10-31 06:03:25
|
Sorry to pester everyone with so many questions, I'm creating a large object with the intention of zooming around and rotating around it, but I'd like to zoom out initially enough to fit the object to screen, I can't seem to get this to work? I need to calculate the end size of the object and then set the camera accordingly right? ********************************************************************** IMPORTANT - This email and any attachments may contain confidential or privileged information intended solely for the intended recipient and / or copyrighted material. If you are not the intended recipient you must not use, interfere with, disclose, copy or take any action with reliance on this email or any part of it. If you have received this email in error please advise the sender via return email and delete or destroy all copies of this email and attachments. Any claim to confidentiality or privilege is not waived or lost by reason of mistaken transmission of this message. Any unauthorised use, copying or distribution is prohibited. Minara Resources Limited does not warrant that this email or any attachments are free of viruses and cannot guarantee the accuracy, reliability or completeness of this email and any attachments. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com ********************************************************************** |
|
From: Ian M. <geo...@gm...> - 2009-10-31 03:34:35
|
PyOpenGL can handle large datasets, yes. I would recommend a vertex buffer object, or display list. As for mouse movement, you can use OpenGL.GLUT somehow, or other packages like PyGame. |
|
From: Tim S. (25121) <tk...@mi...> - 2009-10-31 00:11:59
|
I'm trying to build a 3d model using a large number of triangles. Can pyopengl handle large datasets? Potentially we are talking about building a 500,000 triangle model or even more. Also, the nehe1 tuts don't cover mouse input? I'd like to be able to manipulate my model using the mouse, can you recommend a tutorial covering mice? ********************************************************************** IMPORTANT - This email and any attachments may contain confidential or privileged information intended solely for the intended recipient and / or copyrighted material. If you are not the intended recipient you must not use, interfere with, disclose, copy or take any action with reliance on this email or any part of it. If you have received this email in error please advise the sender via return email and delete or destroy all copies of this email and attachments. Any claim to confidentiality or privilege is not waived or lost by reason of mistaken transmission of this message. Any unauthorised use, copying or distribution is prohibited. Minara Resources Limited does not warrant that this email or any attachments are free of viruses and cannot guarantee the accuracy, reliability or completeness of this email and any attachments. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com ********************************************************************** |
|
From: Prashant S. <ani...@ya...> - 2009-10-24 06:57:09
|
I am rewriting an old python application. The application uses glRect, texture based font system and gluNurbsCurve only.
The application used displayList and glSelectWithCallback function for hit testing.
App is working fine under PyOpenGL 3.1 as of now. Shall I continue using old method or they will be deprecated in near future.
If I use array based geo instead of glRect, would I be gaining some performance here?
How do I replace display list mechanism? For example I am drawing three "glRect" in a displayList and calling list back to draw them.
How selection/picking would be handled in PyOpenGl 3.1?
Cheers
Prashant
From cricket scores to your friends. Try the Yahoo! India Homepage! http://in.yahoo.com/trynew
|
|
From: Jason H. <jas...@vo...> - 2009-10-21 21:44:51
|
You could take a look at a package I was writing a while back, located here: http://www.sugarpy.com/ What you can download doesn't have the node graph stuff you'll see on most of the page. Rather, the package is a 3D viewport with controls similar to 3d packages like Maya or 3dsmax, embedded in a wxPython frame. At the bottom of the page, there is a link to download the package. It uses a combination of wxPython and PyOpenGL. It was my first serious attempt at using the two, as I too am still fairly new to OpenGL. Hope this helps. -Jason -----Original Message----- From: Tim Smith (25121) [mailto:tk...@mi...] Sent: Monday, October 19, 2009 5:06 PM To: pyo...@li... Subject: [PyOpenGL-Users] Tutorial Can anyone recommend a tutorial for someone familiar with python but a beginner at opengl and it's concepts? I'd like to use wxpython with it's opengl canvas as well, as I've written applications in it before and it'll make the gui a snap. ********************************************************************** IMPORTANT - This email and any attachments may contain confidential or privileged information intended solely for the intended recipient and / or copyrighted material. If you are not the intended recipient you must not use, interfere with, disclose, copy or take any action with reliance on this email or any part of it. If you have received this email in error please advise the sender via return email and delete or destroy all copies of this email and attachments. Any claim to confidentiality or privilege is not waived or lost by reason of mistaken transmission of this message. Any unauthorised use, copying or distribution is prohibited. Minara Resources Limited does not warrant that this email or any attachments are free of viruses and cannot guarantee the accuracy, reliability or completeness of this email and any attachments. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.clearswift.com ********************************************************************** ------------------------------------------------------------------------ ------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ PyOpenGL Homepage http://pyopengl.sourceforge.net _______________________________________________ PyOpenGL-Users mailing list PyO...@li... https://lists.sourceforge.net/lists/listinfo/pyopengl-users This message, including any attachments, may contain privileged and/or confidential information. Any distribution or use of this email by anyone other than the intended recipient(s) is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies. Thank you. |
|
From: Ian M. <geo...@gm...> - 2009-10-20 02:15:10
|
Hi, I learned by reverse engineering NeHe tutorials and other code. The NeHe tutorials written in the C languages are fairly unwieldy, but there are some Python ports around. An excellent package to use with PyOpenGL is the PyGame library (pygame.org). Here are the first 10 NeHe tutorials for Python and PyGame http://www.pygame.org/gamelets/games/nehe1-10.zip. I also have a tutorials page http://geometrian.com/Tutorials.php, which might or might be useful. Ian |