pyopengl-users Mailing List for PyOpenGL (Page 92)
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: Mike C. F. <mcf...@ro...> - 2004-03-12 17:40:40
|
Okay, I've confirmed that this is a bug in PyOpenGL 2.0.1.07, and also in CVS. The _PyObject_Dimension(obj0, 1) call is for the wrong object, it should be _PyObject_Dimension(obj3, 1) so that it's taking the size of the array, not the integer constant specifying the size of the array. The problem arose because this code uses the (crufty, evil) d_3_0 SWIG hacks to get the dimension of the array. When doing the SWIG 1.3.13 conversion I tried to find and update all of those hacks to fit the SWIG 1.3.13 version of the hack (argument numbering changed between those versions), but I apparently missed this one. A cleaner mechanism, hopefully, will be available once we transition to SWIG 1.3.21. Anyway, I've checked the (2-character) fix into CVS on both the head (2.0.1 maintenance) and dev-2_1 branches. And now I must get to real work. Have fun, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Ralph G. <ral...@em...> - 2004-03-12 15:52:22
|
I am happy that you are there right now. This might save my weekend! (-; Anyway, I just hacked together an impressive example script. One for the old version which works fine and one for the new version. I hope I didn't make any stupid mistakes. PyGL 1.5.7: #!/usr/bin/env python import string, sys from OpenGL.GL import * from OpenGL.GLUT import * def display(*args): glClearColor(0.0, 0.0, 0.0, 0.0) glClear(GL_COLOR_BUFFER_BIT) glColor3f(1.0,1.0,1.0) glLineWidth(4.0) curve=[0.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0,0.0,1.0,1.0,0.0] glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, curve) glEnable(GL_MAP1_VERTEX_3) glBegin(GL_LINE_STRIP) for i in range(0,30,1): glEvalCoord1f(i/30.0) glEnd() glDisable(GL_MAP1_VERTEX_3) glFlush() def setup_viewport(): glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(-1.0, 2.0, -1.0, 2.0, -1.0, 2.0) def reshape(w, h): glViewport(0, 0, w, h) setup_viewport() def main(): glutInit('foo') glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB) glutInitWindowSize(300, 300) glutCreateWindow('Test') setup_viewport() glutSetReshapeFuncCallback(reshape) glutReshapeFunc() glutSetDisplayFuncCallback(display) glutDisplayFunc() # glutSetIdleFuncCallback(display) # glutIdleFunc() glutMainLoop() main() PyGL 2.0.1.07: #!/usr/bin/env python import string, sys from OpenGL.GL import * from OpenGL.GLUT import * def display(*args): glClearColor(0.0, 0.0, 0.0, 0.0) glClear(GL_COLOR_BUFFER_BIT) glColor3f(1.0,1.0,1.0) glLineWidth(4.0) curve=[[0.0,0.0,0.0],[0.0,1.0,0.0],[0.0,1.0,0.0],[1.0,1.0,0.0]] glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, curve) glEnable(GL_MAP1_VERTEX_3) glBegin(GL_LINE_STRIP) for i in range(0,30,1): glEvalCoord1f(i/30.0) glEnd() glDisable(GL_MAP1_VERTEX_3) glFlush() def setup_viewport(): glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(-1.0, 2.0, -1.0, 2.0, -1.0, 2.0) def reshape(w, h): glViewport(0, 0, w, h) setup_viewport() def main(): glutInit(sys.argv) glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB) glutInitWindowSize(300, 300) glutCreateWindow('Test') setup_viewport() glutReshapeFunc(reshape) glutDisplayFunc(display) glutMainLoop() main() |
From: Ralph G. <ral...@em...> - 2004-03-12 14:13:09
|
Thanks for the fast answer. On Friday, Mar 12, 2004, at 14:36 Europe/Berlin, Mike C. Fletcher wrote: > > It's not actually PyOpenGL that's complaining here, it's OpenGL > itself. PyOpenGL is just a shim layer that passes things into the > lower-level engine. Looking around, I can't find any test code for > glMap1f, so it's entirely possible this is some un-exercised bug in > the shim for glMap1f. It would be much easier to track down if you > could put together a minimal script that produces the error (i.e. > including the data-points array you're passing as well). > The script I am running right now is a little to big, but I will try to get a minimal script and send it ASAP. As to the datapoints I am passing, it is a list of 4 lists with three float values each. Like that glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, [[0.0,0.0,0.0],[100.0,100.0,0.0],[100.0,100.0,0.0],[200.0,200.0,0.0]]) OpenGL.GL.GLerror: [Errno 1281] invalid value I also tried a lot of other combinations, but nothing worked so far. Is this matrix wrong? Ralph > My best guess is that order (length of points in the array) is > exceeding the system's maximum value or that you're passing it a > string (which may even have worked in 1.5.7, as that was a very > different code-base). > > From the manual, here's the situations where invalid value gets > returned: > > * GL_INVALID_VALUE is generated if u1 is equal to u2. > * GL_INVALID_VALUE is generated if stride is less than the number of > values in a control point. > * GL_INVALID_VALUE is generated if order is less than 1 or greater > than the return value of GL_MAX_EVAL_ORDER. > > So, in your case > > * u1 != u2, that's fine > * potentially stride is being mis-calculated > o if, for instance a string were being passed (which would > have a calculated stride of -1 if I'm reading correctly, as > it special-cases strings to avoid infinite recursion) it > should complain about the negative stride, though that's not > actually documented AFAICS > * order is too large for the system > > So, assuming you're passing an X by Y matrix where X=3 and Y=order > (which is what points[][] in the method signature says is required); > the shim code appears to be correct. It's passing stride as dimension > 1 of the passed matrix (size of each element) and order as dimension 0 > of the matrix (number of elements). > > HTH, > Mike > > _______________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://members.rogers.com/mcfletch/ > > |
From: Mike C. F. <mcf...@ro...> - 2004-03-12 13:47:25
|
Ralph Gauges wrote: ... > I recently started using pyopengl. So far I have written my program in > Debian which uses the old pyopengl 1.5.7. > I uses the function glMap1f to draw some simple Bezier curves. In the > old pyopengl 1.5.7 it works just fine, but in the new version 2.0.1.07 > which I installed on my apple, I can't get it to work. > Yes I know, the number of arguments has changed from 6 to 4 and I > already removed the two extra arguments order and stride, but it still > does not work. I always get an error > > glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, curve) > OpenGL.GL.GLerror: [Errno 1281] invalid value > > > I have no clue as to which value pyopengl thinks to be invalid. > Could someone please tell me what I am missing? It's not actually PyOpenGL that's complaining here, it's OpenGL itself. PyOpenGL is just a shim layer that passes things into the lower-level engine. Looking around, I can't find any test code for glMap1f, so it's entirely possible this is some un-exercised bug in the shim for glMap1f. It would be much easier to track down if you could put together a minimal script that produces the error (i.e. including the data-points array you're passing as well). My best guess is that order (length of points in the array) is exceeding the system's maximum value or that you're passing it a string (which may even have worked in 1.5.7, as that was a very different code-base). From the manual, here's the situations where invalid value gets returned: * GL_INVALID_VALUE is generated if u1 is equal to u2. * GL_INVALID_VALUE is generated if stride is less than the number of values in a control point. * GL_INVALID_VALUE is generated if order is less than 1 or greater than the return value of GL_MAX_EVAL_ORDER. So, in your case * u1 != u2, that's fine * potentially stride is being mis-calculated o if, for instance a string were being passed (which would have a calculated stride of -1 if I'm reading correctly, as it special-cases strings to avoid infinite recursion) it should complain about the negative stride, though that's not actually documented AFAICS * order is too large for the system So, assuming you're passing an X by Y matrix where X=3 and Y=order (which is what points[][] in the method signature says is required); the shim code appears to be correct. It's passing stride as dimension 1 of the passed matrix (size of each element) and order as dimension 0 of the matrix (number of elements). HTH, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Ralph G. <ral...@em...> - 2004-03-12 09:26:25
|
Hi, I recently started using pyopengl. So far I have written my program in Debian which uses the old pyopengl 1.5.7. I uses the function glMap1f to draw some simple Bezier curves. In the old pyopengl 1.5.7 it works just fine, but in the new version 2.0.1.07 which I installed on my apple, I can't get it to work. Yes I know, the number of arguments has changed from 6 to 4 and I already removed the two extra arguments order and stride, but it still does not work. I always get an error glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, curve) OpenGL.GL.GLerror: [Errno 1281] invalid value I have no clue as to which value pyopengl thinks to be invalid. Could someone please tell me what I am missing? Thanks a lot Ralph |
From: SourceForge.net <no...@so...> - 2004-03-12 02:57:41
|
Feature Requests item #907393, was opened at 2004-03-01 01:13 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=907393&group_id=5988 Category: GLU Group: None Status: Closed Resolution: Works For Me Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Mike C. Fletcher (mcfletch) Summary: SDL support Initial Comment: Hi, Is there going to be support for PyOpenGL working nicely with SDL/Pygame? GLU/GLUT don't satisfy most needs for even a half-way decent game. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2004-03-11 18:47 Message: Logged In: NO PyOpenGL works with Pygame just like OpenGL works with SDL. Here's a sample program found online: import sys # All we will use is the sys.exit() routine import pygame # Tell python we want to use the pygame module from random import choice # Imports the choice() function # from the random module from pygame.locals import * # Imports the constant symbols from # pygame.locals - like OPENGL, K_1, etc... from OpenGL.GL import * # This is so we can just do glXXXX() # instead of OpenGL.GL.glXXXXX() rot1=0 rot2=0 direction1=0 direction2=0 # Colors for the inner rectangle square1Colors=[[1,0,0,1],[0,1,0,1],[0,0,1,1],[1,1,1,1]] # Vertices of the inner rectangle square1Vertices=[[-64,-64],[64,-64],[64,64],[-64,64]] # Texture coordinates for the outer rectangle square2TexCoords=[[0,0],[1,0],[1,1],[0,1]] # Vertices of the outer rectangle square2Vertices=[[-128,-128],[128,-128],[128,128],[-128,128]] def draw (): # global means use the values declared in the global scope outside this function global rot1,rot2,direction1,direction2 global square1Colors,square1Vertices,square2TexCoords,square2Vertices glClearColor(0.0,0.0,0.0,0.0) glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) # Select GL_MODELVIEW matrix glMatrixMode(GL_MODELVIEW) # Save current GL_MODELVIEW matrix state glPushMatrix() # Translate 200 units to the right and back glTranslatef(200,200,0) # Tell OpenGL that we will use a color-array glEnableClientState(GL_COLOR_ARRAY) # Tell OpenGL that we will use a vertex-array glEnableClientState(GL_VERTEX_ARRAY) # square1Colors contains colors for square1 glColorPointerf(square1Colors) # square1Vertices contains vertices for square1 glVertexPointerf(square1Vertices) glRotatef(rot2,0,0,1) # Rotate square1 around (0,0,1) rot2=(rot2+direction2)%360 # Update rot2 value glBegin(GL_QUADS) # Tell OpenGL that we will draw quads glArrayElement(0) # First element in vertex-array glArrayElement(1) # Second element in vertex-array glArrayElement(2) # Third element in vertex-array glArrayElement(3) # Fourth element in vertex-array glEnd() glDisableClientState(GL_COLOR_ARRAY) # Disable color-array # Restore last GL_MODELVIEW matrix state glPopMatrix() # Save current GL_MODELVIEW matrix state glPushMatrix() # Translate 200 units to the right and back glTranslatef(200,200,0) # Enable 2D texturemapping glEnable(GL_TEXTURE_2D) # Enable blending glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) # Define blending function # Tell OpenGL that we will use a texture-coord-array glEnableClientState(GL_TEXTURE_COORD_ARRAY) # Tell OpenGL that we will use a vertex-array glEnableClientState(GL_VERTEX_ARRAY) # square2TexCoords contains texture coordinates for square2 glTexCoordPointerf(square2TexCoords) # square2Vertices contains vertices for square2 glVertexPointerf(square2Vertices) glRotatef(rot1,0,0,1) # Rotate squre2 around (0,0,1) rot1=(rot1+direction1)%360 # Update rot1 value glBegin(GL_QUADS) # Tell OpenGL that we will draw quads glArrayElement(0) # First element of vertex-array glArrayElement(1) # Second element of vertex-array glArrayElement(2) # Third element of vertex-array glArrayElement(3) # Fourth element of vertex-array glTexCoord2f(0,0) glEnd() glDisable(GL_BLEND) # Disable blending state glDisable(GL_TEXTURE_2D) # Disable 2D texturemapping glFlush() # Flush everything to screen ASAP # Restore last GL_MODELVIEW matrix state glPopMatrix() pygame.display.flip() # Flip the double-buffer pygame.init() # kickstart pygame # we want a fullscreen, 1280x1024, SDL surface that supports doublebuffered OpenGL #pygame.display.set_mode((1280,1024),OPENGL|DOUBLEBUF|FULLSCREEN) pygame.display.gl_set_attribute(GL_ALPHA_SIZE, 8) pygame.display.set_mode((800,600),OPENGL|DOUBLEBUF) # create the partially transparent texture # pixel format is: \xRR\xGG\xBB\xAA Red,Green,Blue,Alpha tex="" for i in xrange(512): tex+="\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f" tex+="\xff\xff\xff\x3f\xff\xff\xff\x3f\xff\xff\xff\x3f\xff\xff\xff\x3f" glTexImage2D(GL_TEXTURE_2D,0,4,64,64,0,GL_RGBA,GL_UNSIGNED_BYTE,tex) # Clamp our texture glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP) glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP) # Magnification filter is linear glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR) # Minification filter is linear glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR) # Texture will not be affected by current color state glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE) glDisable(GL_DEPTH_TEST) # No depth testing glMatrixMode(GL_PROJECTION) # Select GL_PROJECTION matrix glLoadIdentity() # Reset GL_PROJECTION matrix #glOrtho (0,1280,0,1024,-1,1) # Set up orthographic projection glOrtho (0,800,0,600,-1,1) # Set up orthographic projection draw() # Call draw function # put random wave files in the soundList list # provide your own .wav files #soundList=[] ##soundList.append(pygame.mixer.Sound("dingdong.wav")) #soundList.append(pygame.mixer.Sound("trumpet1.wav")) #soundList.append(pygame.mixer.Sound("boo.wav")) # the nice and simple event loop while 1: event=pygame.event.poll () if event.type is QUIT: sys.exit(0) draw() if event.type is KEYDOWN: if event.key is K_ESCAPE: sys.exit(0) if event.key is K_1: choice(soundList).play() direction2=2 if event.key is K_2: choice(soundList).play() direction2=-2 if event.key is K_3: choice(soundList).play() direction2=0 if event.key is K_4: choice(soundList).play() direction1=2 if event.key is K_5: choice(soundList).play() direction1=-2 if event.key is K_6: choice(soundList).play() direction1=0 ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2004-03-01 01:42 Message: Logged In: YES user_id=34901 PyGame is certainly supported for most things. For instance, OpenGLContext has a fairly extensive PyGame context. There are translations of the first 10 NeHe tutorials to raw PyGame available from the PyGame site, etceteras. Certain things, such as using PyGame movies as images haven't AFAIK been tried, but likely wouldn't be too impossibly hard with a fairly minimal extension or two. BTW, GLU doesn't have anything to do with the GUI library as such, it's just a set of utilities for working with OpenGL. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=907393&group_id=5988 |
From: Ben K. <the...@f-...> - 2004-03-09 10:42:01
|
I would like to see a tarball (or even a zipfile) of the docs for offline view. |
From: Greg H. <gho...@co...> - 2004-03-07 09:46:56
|
I'm wondering if SwapBuffers() (double-buffering) is implicitly handled by the PyOpenGL implementation, or if it requires an init option like GLUT_DOUBLE when using glut? I'm running Python 2.3 and PyOpenGL 2.0 on Mac OS 10.3. Thanks. --Greg |
From: Greg H. <gho...@co...> - 2004-03-07 09:02:32
|
Ignore my question...I realized that the SwapBuffers() is supported by wxWindows rather than PyOpenGL. Thanks. --Greg |
From: Michael D. <dat...@op...> - 2004-03-02 01:32:30
|
As suggested in another post the use of glColorTableEXT instead of glColorTable, but the following error occurs when its involked glColorTableEXT(GL_PROXY_COLOR_TABLE_EXT, GL_RGB, 512, GL_RGB, GL_UNSIGNED_BYTE, colourTable) OpenGL.GL.GLerror: [Errno (1282,)] Dynamic function loading not implemented/supported on this platform running linux if that is of any concern. |
From: SourceForge.net <no...@so...> - 2004-03-01 09:46:45
|
Feature Requests item #907393, was opened at 2004-03-01 04:13 Message generated for change (Comment added) made by mcfletch You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=907393&group_id=5988 Category: GLU Group: None >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Mike C. Fletcher (mcfletch) Summary: SDL support Initial Comment: Hi, Is there going to be support for PyOpenGL working nicely with SDL/Pygame? GLU/GLUT don't satisfy most needs for even a half-way decent game. ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2004-03-01 04:42 Message: Logged In: YES user_id=34901 PyGame is certainly supported for most things. For instance, OpenGLContext has a fairly extensive PyGame context. There are translations of the first 10 NeHe tutorials to raw PyGame available from the PyGame site, etceteras. Certain things, such as using PyGame movies as images haven't AFAIK been tried, but likely wouldn't be too impossibly hard with a fairly minimal extension or two. BTW, GLU doesn't have anything to do with the GUI library as such, it's just a set of utilities for working with OpenGL. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=907393&group_id=5988 |
From: SourceForge.net <no...@so...> - 2004-03-01 09:18:04
|
Feature Requests item #907393, was opened at 2004-03-01 01:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=907393&group_id=5988 Category: GLU Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: SDL support Initial Comment: Hi, Is there going to be support for PyOpenGL working nicely with SDL/Pygame? GLU/GLUT don't satisfy most needs for even a half-way decent game. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=907393&group_id=5988 |
From: Mike C. F. <mcf...@ro...> - 2004-02-28 10:32:16
|
Michael Dove wrote: > Hi, > just wonder if GlColorTable has been implemented? > I'm running Version: 2.0.1.07. > > OpenGL.GL.glColorTable > Traceback (most recent call last): > File "<stdin>", line 1, in ? > AttributeError: 'module' object has no attribute 'glColorTable' Not sure why, but it's commented out in the current code-base. The glColorTableEXT functions are there: >>> from OpenGL.GL.EXT import color_table >>> help(color_table.glGetColorTableEXT) though I have no testing code to ensure that they really work as implemented. There's actually a lot of this in the code-base, functions that exist in an OpenGL version and also in an extension (or two). Would be nice to abstract that away some time so that the code isn't getting duplicated everywhere. HTH a little, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Michael D. <dat...@op...> - 2004-02-28 09:56:15
|
Hi, just wonder if GlColorTable has been implemented? I'm running Version: 2.0.1.07. OpenGL.GL.glColorTable Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'glColorTable' -Michael |
From: Greg H. <gho...@co...> - 2004-02-22 08:58:53
|
I'm trying to write a simple app using PyOpenG, unfortunately the glColor*() function seems to have no effect. I'm sure I'm just missing something. Any help would be appreciated. The following source code only shows the 2 classes used to extend the wxGLCanvas...the remaining code simply adds a Contour canvas to a Frame and shows the Frame. A polygon shows up, but only in gray. I've tried many variations, all resulting in only a gray polygon. Thank you. class MyCanvasBase(wxGLCanvas): def __init__(self, parent, size, pos = wxDefaultPosition): wxGLCanvas.__init__(self, parent, -1, size = size, pos = pos, attribList = WX_GL_RGBA) self.parent = parent self.size = size self.init = False # initial mouse position self.lastx = self.x = 30 self.lasty = self.y = 30 self.SetColour('white') self.SetCurrent() glViewport(0, 0, self.size.width, self.size.height) EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) EVT_SIZE(self, self.OnSize) EVT_PAINT(self, self.OnPaint) EVT_LEFT_DOWN(self, self.OnMouseDown) # needs fixing... EVT_LEFT_UP(self, self.OnMouseUp) EVT_MOTION(self, self.OnMouseMotion) def OnEraseBackground(self, event): pass # Do nothing, to avoid flashing on MSW. def OnSize(self, event): #size = self.GetClientSize() if self.GetContext(): self.SetCurrent() glViewport(0, 0, self.size.width, self.size.height) def OnPaint(self, event): dc = wxPaintDC(self) self.SetCurrent() glViewport(0, 0, self.size.width, self.size.height) if not self.init: self.InitGL() self.init = True self.OnDraw() def OnMouseDown(self, evt): self.x, self.y = evt.GetPosition() self.CaptureMouse() def OnMouseUp(self, evt): self.ReleaseMouse() def OnMouseMotion(self, evt): if evt.Dragging() and evt.LeftIsDown(): self.lastx, self.lasty = self.x, self.y #self.x, self.y = self.lastx, self.lasty self.x, self.y = evt.GetPosition() self.Refresh(False) class Contourcanvas(MyCanvasBase): def InitGL(self): # set viewing projection glMatrixMode(GL_PROJECTION) glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 3.0) # position viewer glMatrixMode(GL_MODELVIEW) glTranslatef(0.0, 0.0, -2.0) # position object glRotatef(self.y, 1.0, 0.0, 0.0) glRotatef(self.x, 0.0, 1.0, 0.0) glEnable(GL_DEPTH_TEST) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) def OnDraw(self): max = 0; for i in range(NUM_ROWS): for j in range(NUM_COLS): val = int(self.parent.mappanel.grid.GetCellValue(i, j)) if max < val: max = val # clear color and depth buffers glClearColor(1.0, 1.0, 1.0, 1.0) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glBegin(GL_QUADS) glColor3f(1.0, 0.0, 0.0) glVertex3f(0.0, 1.0, 1.0) glVertex3f(0.0, -1.0, -1.0) glColor3f(0.0, 0.0, 1.0) glVertex3f(0.0, -1.0, 1.0) glVertex3f(0.0, 1.0, -1.0) glEnd() glFlush() glRotatef((self.lasty - self.y)/10., 1.0, 0.0, 0.0); glRotatef((self.lastx - self.x)/10., 0.0, 1.0, 0.0); self.SwapBuffers() --Greg |
From: Yannick G. <ygi...@yg...> - 2004-02-15 14:36:03
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On February 11, 2004 19:20, Bob Roberts wrote: > I am looking for a example pyopengl program that can read in a bunch of > points and display them, with the ability to zoom and rotate. Where can > I find something like this? This one is ugly and slow but it's complete except for collision detection. I dumped the object list from Blender with a small python plug-in. You I'll post it too if you want but the Blender API is so simple that I encourage you to write your own so you dump exactly what you want. Use the arrow to move the "player" and the wheel to "zoom". If you do a FPS, change the FOV instead of translating, thats the way a scope works. #----8<--------8<--------8<---- cut here ----8<--------8<--------8<---- #!/usr/bin/python # Author: Yannick Gingras <ygi...@yg...> # largely based on pygame + PyOpenGL version of Nehe's OpenGL lesson07 # by Paul Furber 2001 - m...@ve... import os import math from OpenGL.GL import * from OpenGL.GLU import * import pygame, pygame.image from pygame.locals import * from pprint import pprint from operator import mul, add WHEEL_UP = 4 WHEEL_DOWN = 5 X = 0 Y = 1 Z = 2 SPEED_INC = 0.05 objs = {'cameras': [{'loc': [0.0, -8.1288509368896484, 0.0], 'name': 'Camera', 'rot': [1.5707966089248657, 0.0, 0.0], 'size': [1.0, 1.0, 1.0]}], 'lamps': [{'col': [1.0, 1.0, 1.0], 'energy': 1.0, 'loc': [-2.917271614074707, -20.990573883056641, -5.8118243217468262], 'name': 'Lamp', 'rot': [-1.8678504228591919, -0.041752655059099197, -3.1845359802246094], 'size': [1.5281403064727783, 1.5281403064727783, 1.5281403064727783]}], 'meshs': [ {'faces': [{'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[1.0, 0.99999988079071045, -1.0], [1.0, -1.0, -0.99999994039535522], [-1.0000001192092896, -0.99999988079071045, -1.0], [-0.99999958276748657, 1.0000003576278687, -1.0000001192092896]]}, {'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [0.57734918594360352, -0.57734918594360352, 0.57734918594360352]], 'uvs': [], 'verts': [[1.0000004768371582, 0.9999995231628418, 1.0], [-1.0, 1.0, 0.99999994039535522], [-1.0000003576278687, -0.99999958276748657, 1.0], [0.9999992847442627, -1.0000005960464478, 1.0000001192092896]]}, {'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [0.57734918594360352, -0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[1.0, 0.99999988079071045, -1.0], [1.0000004768371582, 0.9999995231628418, 1.0], [0.9999992847442627, -1.0000005960464478, 1.0000001192092896], [1.0, -1.0, -0.99999994039535522]]}, {'image': '', 'normals': [[0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[1.0, -1.0, -0.99999994039535522], [0.9999992847442627, -1.0000005960464478, 1.0000001192092896], [-1.0000003576278687, -0.99999958276748657, 1.0], [-1.0000001192092896, -0.99999988079071045, -1.0]]}, {'image': '', 'normals': [[-0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[-1.0000001192092896, -0.99999988079071045, -1.0], [-1.0000003576278687, -0.99999958276748657, 1.0], [-1.0, 1.0, 0.99999994039535522], [-0.99999958276748657, 1.0000003576278687, -1.0000001192092896]]}, {'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, 0.57734918594360352]], 'uvs': [], 'verts': [[1.0000004768371582, 0.9999995231628418, 1.0], [1.0, 0.99999988079071045, -1.0], [-0.99999958276748657, 1.0000003576278687, -1.0000001192092896], [-1.0, 1.0, 0.99999994039535522]]}], 'loc': [6.7445888519287109, 6.4222369194030762, -6.185572624206543], 'name': 'Player', 'rot': [1.5707963705062866, -4.2663355487304599e-17, 1.5707963705062866], 'size': [1.0, 1.0, 1.0]}, {'faces': [{'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[1.0, 0.99999994039535522, -1.0], [1.0, -1.0, -1.0], [-1.0000001192092896, -0.99999982118606567, -1.0], [-0.99999964237213135, 1.0000003576278687, -1.0]]}, {'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [0.57734918594360352, -0.57734918594360352, 0.57734918594360352]], 'uvs': [], 'verts': [[1.0000004768371582, 0.99999946355819702, 1.0], [-0.99999994039535522, 1.0, 1.0], [-1.0000003576278687, -0.99999964237213135, 1.0], [0.99999934434890747, -1.0000005960464478, 1.0]]}, {'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [0.57734918594360352, -0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[1.0, 0.99999994039535522, -1.0], [1.0000004768371582, 0.99999946355819702, 1.0], [0.99999934434890747, -1.0000005960464478, 1.0], [1.0, -1.0, -1.0]]}, {'image': '', 'normals': [[0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[1.0, -1.0, -1.0], [0.99999934434890747, -1.0000005960464478, 1.0], [-1.0000003576278687, -0.99999964237213135, 1.0], [-1.0000001192092896, -0.99999982118606567, -1.0]]}, {'image': '', 'normals': [[-0.57734918594360352, -0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, -0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, -0.57734918594360352]], 'uvs': [], 'verts': [[-1.0000001192092896, -0.99999982118606567, -1.0], [-1.0000003576278687, -0.99999964237213135, 1.0], [-0.99999994039535522, 1.0, 1.0], [-0.99999964237213135, 1.0000003576278687, -1.0]]}, {'image': '', 'normals': [[0.57734918594360352, 0.57734918594360352, 0.57734918594360352], [0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, -0.57734918594360352], [-0.57734918594360352, 0.57734918594360352, 0.57734918594360352]], 'uvs': [], 'verts': [[1.0000004768371582, 0.99999946355819702, 1.0], [1.0, 0.99999994039535522, -1.0], [-0.99999964237213135, 1.0000003576278687, -1.0], [-0.99999994039535522, 1.0, 1.0]]}], 'loc': [-1.3737921714782715, 17.224937438964844, 3.9241774082183838], 'name': 'Cube', 'rot': [1.5708620548248291, 1.3671789395042211e-16, 1.3672688044059689e-16], 'size': [1.0, 1.0, 1.0]}]} xrot = yrot = 0.0 xspeed = yspeed = zspeed = 0.0 z = 0.0 textures = [] texMap = {} filter = 0 light = 0 zoom = 0.0 LightAmbient = ( (0.5, 0.5, 0.5, 1.0) ); LightDiffuse = ( (1.0, 1.0, 1.0, 1.0) ); LightPosition = ( (0.0, 0.0, 2.0, 1.0) ); def resize((width, height)): if height==0: height=1 glViewport(0, 0, width, height) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45, 1.0*width/height, 0.1, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() def getTexMap(): texMap = {} for obj in objs["meshs"]: for face in obj["faces"]: if face["image"]: texMap[face["image"]] = None return texMap def load_textures(): global textures, texMap texMap = getTexMap() textures = glGenTextures(len(texMap.keys())) # undo the magic try: len(textures) except TypeError: textures = [textures] for key, tex in zip(texMap.keys(), textures): texMap[key] = tex texturefile = os.path.join(os.curdir, key) textureSurface = pygame.image.load(texturefile) textureData = pygame.image.tostring(textureSurface, "RGBX", 1) glBindTexture(GL_TEXTURE_2D, tex) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, textureSurface.get_width(), textureSurface.get_height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData ) def init(): glEnable(GL_TEXTURE_2D) load_textures() glShadeModel(GL_SMOOTH) glClearColor(0.0, 0.0, 0.0, 0.0) glClearDepth(1.0) glEnable(GL_DEPTH_TEST) glDepthFunc(GL_LEQUAL) glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) lamps = objs["lamps"] if len(lamps) > GL_MAX_LIGHTS: raise Exception("To many lamps !") for lamp, i in zip(lamps, range(len(lamps))): glLightfv( GL_LIGHT0 + i, GL_AMBIENT, LightAmbient ) glLightfv( GL_LIGHT0 + i, GL_DIFFUSE, LightDiffuse ) glLightfv( GL_LIGHT0 + i, GL_POSITION, lamp["loc"] + [1.0] ) glEnable( GL_LIGHT0 + i ) glEnable(GL_LIGHTING) def rad2deg(radAngle): degs = radAngle * 360.0 / math.pi / 2.0 return degs def draw(): global xrot, yrot, xspeed, yspeed, z, filter, texMap glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # we always use the 1st camera cam = objs["cameras"][0] for obj in objs["meshs"]: glLoadIdentity() # cam use rev. coords # I don't know why but Z must rotate 1st glRotated(-rad2deg(cam["rot"][Z]), 0.0, 0.0, 1.0) glRotated(-rad2deg(cam["rot"][Y]), 0.0, 1.0, 0.0) glRotated(-rad2deg(cam["rot"][X])+xrot, 1.0, 0.0, 0.0) glTranslatef( -cam["loc"][X], -cam["loc"][Y] - zoom, -cam["loc"][Z] ) loc = list(obj["loc"]) loc[2] += z glTranslatef(*loc) # I don't know why but Z must rotate 1st glRotated(rad2deg(obj["rot"][Z]), 0.0, 0.0, 1.0) glRotated(rad2deg(obj["rot"][Y]), 0.0, 1.0, 0.0) glRotated(rad2deg(obj["rot"][X]), 1.0, 0.0, 0.0) for face in obj["faces"]: image = face["image"] if image: glBindTexture(GL_TEXTURE_2D, texMap[image]) else: glColor3f(1.0, 1.0, 1.0) glBegin(GL_POLYGON) uvs = (face["uvs"] or [None] * len(face["verts"])) for vert, normal, uv in zip(face["verts"], face["normals"], uvs): vert = map(mul, vert, obj["size"]) glNormal3f(*normal) if image: glTexCoord2f(*uv) glVertex3f(*vert) glEnd(); def getPlayer(): for mesh in objs["meshs"]: if mesh["name"] == "Player": return mesh def handle_keys(key): global filter, light, z, xspeed, yspeed, zspeed, xrot if key == K_ESCAPE: return 0 if key == K_f: filter = filter + 1 if filter == 3: filter = 0 elif key == K_PAGEUP: z -= 0.5 elif key == K_PAGEDOWN: z += 0.5 elif key == K_UP: zspeed += SPEED_INC elif key == K_DOWN: zspeed -= SPEED_INC elif key == K_RIGHT: xspeed += SPEED_INC elif key == K_LEFT: xspeed -= SPEED_INC return 1 def handle_key_up(key): global filter, light, z, xspeed, yspeed, zspeed, xrot if key == K_UP: zspeed -= SPEED_INC elif key == K_DOWN: zspeed += SPEED_INC elif key == K_RIGHT: xspeed -= SPEED_INC elif key == K_LEFT: xspeed += SPEED_INC def move_player(): player = getPlayer() player["loc"][Z] += zspeed player["loc"][X] += xspeed def handle_mouse(event): global zoom zoomFact = 0.5 if event.button == WHEEL_UP: zoom += zoomFact elif event.button == WHEEL_DOWN: zoom -= zoomFact def main(): video_flags = OPENGL|DOUBLEBUF pygame.init() surface = pygame.display.set_mode((640,480), video_flags) resize((640,480)) init() frames = 0 ticks = pygame.time.get_ticks() while 1: event = pygame.event.poll() if event.type == QUIT: break if event.type == KEYDOWN: if handle_keys(event.key) == 0: break if event.type == KEYUP: handle_key_up(event.key) if event.type == MOUSEBUTTONDOWN: handle_mouse(event) move_player() draw() pygame.display.flip() frames = frames+1 print "fps: %d" % ((frames*1000)/(pygame.time.get_ticks()-ticks)) if __name__ == '__main__': main() #----8<--------8<--------8<---- cut here ----8<--------8<--------8<---- - -- Yannick Gingras "please call it ``GNU/Linux''" Coder for OBB : Overhead Bloodshot Berit -- Richard M. Stallman http://OpenBeatBox.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFAL4MUZJ8/OobqizMRAqvdAJkBRdHnQZQqL/AZpg2KOtLYRfqFuQCgozpG jZen8EA1Pdma4ZizPDQUYPE= =2eHy -----END PGP SIGNATURE----- |
From: Bob R. <bob...@co...> - 2004-02-12 00:21:45
|
I am looking for a example pyopengl program that can read in a bunch of points and display them, with the ability to zoom and rotate. Where can I find something like this? |
From: Mike C. F. <mcf...@ro...> - 2004-02-01 21:45:19
|
I'm going to try to get some time to do this. Right now I want to concentrate on porting to SWIG 1.3.20. Honestly I didn't even know it was *possible* to build with numarray. Going to have to figure out how to differentiate between numpy and numarray during build to change the binary name. Thanks for the heads up. Sigh, Mike John F Meinel Jr wrote: > Earlier I posted a message stating that I had difficulties importing > OpenGL and that the problem resided in GL__init___.pyd > I believe I found the problem. > Specifically, PyOpenGL depends on numarray, not Numeric (numpy). > If you run from a console you will see this error: ... _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: John F M. Jr <jo...@jo...> - 2004-02-01 04:54:02
|
Earlier I posted a message stating that I had difficulties importing OpenGL and that the problem resided in GL__init___.pyd I believe I found the problem. Specifically, PyOpenGL depends on numarray, not Numeric (numpy). If you run from a console you will see this error: $ /cygdrive/c/Python23/python Python 2.3.2 (#49, Oct 2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import OpenGL Fatal Python error: Can't import module 'numarray.libnumarray' If you are using a Python GUI such as IDLE, it will only give you a runtime error. Once I installed numarray-0.8, I could import OpenGL just fine. Please update you're documentation to indicate this dependency change. Or at the very least, change the name of the executable from: PyOpenGL-2.0.1.07.py2.3-numpy23.exe <http://prdownloads.sourceforge.net/pyopengl/PyOpenGL-2.0.1.07.py2.3-numpy23.exe?download> to PyOpenGL-2.0.1.07.py2.3-numarray0.8.exe Other than this small dependency problem, thank you very much for making OpenGL work under python. John =:-> |
From: John F M. Jr <jo...@jo...> - 2004-02-01 04:07:02
|
I am getting the same problem that an earlier person posted about a Visual C++ runtime error. I tracked down the problem to the call: import GL__init___ (Note the three '_' at the end. This is when it tries to import the GL__init___.pyd DLL. Does anyone have an idea of what is causing this, or what I could do to try to troubleshoot this problem? I'm trying to download the source and do a custom compile, but I was hoping there would be something obvious. I checked, and I should have all of the dependencies that were mentioned. Thanks, John =:-> |
From: Rick M. <rm...@sa...> - 2004-01-31 06:53:17
|
Does anyone have an example of using OpenGL.trackball? I'm having a hard time getting it to work. I initialize the trackball: self.tb = Trackball() On mouse movement (I'm doing this under GtkGLExt, so it's called ButtonMovement, but the idea is the same) I do: def button_motion(self, width, height, event): if event.state == gtk.gdk.BUTTON1_MASK: self.tb.update(self.beginx,self.beginy,event.x,event.y, width,height) Finally, in display I do this: def display(self, *args): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glPushMatrix() glTranslatef(self.transx,self.transy,self.depth) rotmtx = self.tb.matrix glMultMatrixf(rotmtx) glCallList(1) glPopMatrix() return Am I doing something bone-headed here? In the past I've just done the rotations by hand, but I wanted to implement a real trackball. R. Rick Muller rm...@sa... |
From: Mike C. F. <mcf...@ro...> - 2004-01-28 08:05:39
|
See this article: http://sourceforge.net/mailarchive/forum.php?thread_id=3785431&forum_id=4353 which gives a work-around for building on RedHat. Togl can, just as easily, be disabled by editing your config/linux.cfg file and specifying 0 for the build_togl flag. Togl is moving toward deprecation, as it's proving to be a serious pain and there's no-one to champion its continued maintenance. Enjoy yourself, Mike Rick Muller wrote: > I recently came across the following error while building PyOGL on > RH9.0 under both Python 2.2 and 2.3.2 > > warning: error while loading Togl.so: can't find package Tk 8.1 > > 'setup.py build' worked fine, I only saw this error upon running > 'setup.py install'. I'm running Tk8.3, so I don't know why it's > looking for 8.1. > > I've built PyOGL on Mac OS X/fink and RH8.0 and have never before > seen this problem. > > I googled the error and found a couple of other occurances of this > error (e.g. > http://coding.derkeiler.com/Archive/Python/comp.lang.python/2003-10/ > 4128.html), but no suggested work arounds. > > Can anyone suggest a fix or a workaround. Thanks in advance, > > R. > > Rick Muller > rm...@sa... > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > -- _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Rick M. <rm...@sa...> - 2004-01-27 22:58:22
|
Wanted to update everyone on the progress of this bug. Turns out the bug is *not* a problem with the PyOpenGL library, but rather with the pygtkgl bindings. There is a bugzilla site here that details the bug: http://bugzilla.gnome.org/show_bug.cgi?id=132058 Hopefully this will be fixed and committed RSN. Rick Rick Muller rm...@sa... |
From: Rick M. <rm...@sa...> - 2004-01-27 16:12:43
|
I recently came across the following error while building PyOGL on RH9.0 under both Python 2.2 and 2.3.2 warning: error while loading Togl.so: can't find package Tk 8.1 'setup.py build' worked fine, I only saw this error upon running 'setup.py install'. I'm running Tk8.3, so I don't know why it's looking for 8.1. I've built PyOGL on Mac OS X/fink and RH8.0 and have never before seen this problem. I googled the error and found a couple of other occurances of this error (e.g. http://coding.derkeiler.com/Archive/Python/comp.lang.python/2003-10/ 4128.html), but no suggested work arounds. Can anyone suggest a fix or a workaround. Thanks in advance, R. Rick Muller rm...@sa... |
From: Rene D. <re...@py...> - 2004-01-22 00:14:06
|
Richard Jones wrote: >On Thursday 18 December 2003 02:34, Rene Dudfield wrote: > > >>downgrade to swig 1.3.13 if you want it to work. Or install 1.3.13 >>somewhere not in your main path, and have your pyopengl build have it in >>its path before the normal swig path. >> >>I just started working on making pyopengl work with 1.3.19. However I'm >>having trouble with the GLU wrapper segfaulting, so it may take a while >>to debug. >> >>Anyone allready got pyopengl working with 1.3.19? >> >> > >Any chance this is remedied yet? > > > Richard > > Nope, no luck :( I've kind of given up on working with the new swig for the moment to try ctypes. Mainly because swig was giving me grief! Your best chance may be to use the pregenerated wrapper files, or download swig 1.3.13. |