pyopengl-users Mailing List for PyOpenGL (Page 62)
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: Prashant S. <ani...@ya...> - 2008-04-27 11:47:40
|
http://code.google.com/p/pyftgl/ Does anybody know how we can use it with python 2.5. I don't know how we can compile and build as it says before we can use it. It would be great if we can have a setup for this. Best regards ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Greg E. <gre...@ca...> - 2008-04-22 00:46:46
|
Prashant Saxena wrote: > When using feedbackBuffer and draw something that is off-screen > then I am not getting the results. You're trying to use OpenGL for something it wasn't designed for. It's meant for drawing things on the screen, so it feels free to ignore anything that would be off-screen. You'll have to do your own calculations for this kind of thing in the program, and not rely on OpenGL. -- Greg |
From: Astan C. <st...@al...> - 2008-04-21 09:34:16
|
Dont worry about this. I found a simple recipe that does this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/115418 Cheers Astan Astan Chee wrote: > Hi, > Im trying to get nehe's lesson 13 to work in python ( > http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13 ) > But it seems that the python port of it is very old (python 2.2) and > that running it gives me a NameError: global name 'wglGetCurrentDC' is > not defined error. > I tried to check the OpenGl.WGL folder and its practically empty. > How do I go about doing this? Or is there a better way to print text in > pyopengl that I havent found yet? Im using python 2.5. > Thanks for any help. > Astan > > -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free. |
From: Astan C. <st...@al...> - 2008-04-21 05:43:17
|
Hi, Im trying to get nehe's lesson 13 to work in python ( http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=13 ) But it seems that the python port of it is very old (python 2.2) and that running it gives me a NameError: global name 'wglGetCurrentDC' is not defined error. I tried to check the OpenGl.WGL folder and its practically empty. How do I go about doing this? Or is there a better way to print text in pyopengl that I havent found yet? Im using python 2.5. Thanks for any help. Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free. |
From: Astan C. <st...@al...> - 2008-04-21 00:04:04
|
Yeah, I just realized this. I also disabled the loading of .mtl files and commented any part that broke because the file didnt exist. Thanks! Mike C. Fletcher wrote: > Astan Chee wrote: >> Hi, >> I have .obj files created by various applications. These .obj files >> have tons of material or textures or other things attached to it. Im >> trying to strip out all this and only keep the vertices (wireframe) >> of the model. Does anyone know how do I do this in python? I've seen >> http://www.pygame.org/wiki/OBJFileLoader?parent=CookBook to load .obj >> files but how do I just take the vertices/shape and keep a standard >> default face/texture for every .obj that I load. >> Thanks for any help. >> Cheers >> Astan >> > Rewrite the code referenced to comment out the glBindTexture, glColor > and glTexCoord2fv calls, set your material/texture before you call the > loader. > > HTH, > Mike > -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free. |
From: Black <py...@bl...> - 2008-04-19 20:58:20
|
On Apr 19, 2008, at 3:18 AM, Prashant Saxena wrote: > In a 2D application using pyOpenGL where I am not using Depth, > there are couple of weired things happenings: > > When using some off-screen co-ordinates with glRasterPos2f, say my > view port is 640x480 where top left is (0,0) and if I am passing > (-10,-10) to > glRasterPos2f then text goes off even though text is long enough to > still appear on screen. That would be how raster operations in OpenGL work. If the point you pass to glRasterPos is outside of the viewport, nothing is displayed. The problem is, unlike the other OpenGL primitives, which can be viewed and worked with as if they were vector graphics until the moment they are rendered, raster operations are working with actual pixels being written to the viewport. If you ask for a place of screen, there is no buffer to write into. OpenGL could potentially extend the buffer, but that could be incredibly costly. It could also try to place each pixel and do a test to see if it falls within the viewport or not, but instead, it takes the easy way out and just dumps it. There are a couple of ways to deal with this: 1. do the calculations yourself to figure out where in the word you are actually onscreen and only render from that point on 2. use texture mapped fonts 3. make your viewport as big as your drawing and use a scroll pane to reduce the viewing area The first option is probably the standard approach. Depending on which GUI toolkit you use, you might be able to get this for free. Several of the non-GLUT alternatives have some kind of text rendering operation that is a little higher level than playing with glRasterPos. I have successfully used the third approach, though it does give you a speed hit since you don't get any benefit from clipping. It also won't work with every GUI toolkit. When I did it I was using QT. I personally like the second approach best. It takes a little more work to get started, but it is much faster than bitmap or pixmap fonts and it doesn't have this boundary problem. > When using feedbackBuffer and draw something that is off-screen > then I am not getting the results. For example If I am drawing some > glPoint where coordinates are inside the viewport area then > feedBackBuffer is giving me results other wise I am not able to get > the proper results. How can I solve this? Why I need this is > because the application is basically a flow chart network where > user can connect node's paramaters using curves to show the > connections between them. It may possible when using panning, some > nodes goes off-screen but still there connection are with some > nodes on screen and I am not able to get the positional data of > nodes that are off screen. I've not played extensively with the feedback buffer, so someone can correct me if I'm wrong, but I believe you have the same problem. The feedback buffer has to be a fixed size - if you try to render outside of that region, you won't see anything. Again, the solution is probably to render so that everything would fit inside of the viewport. of course, if you are just interested in the positions of nodes in a network, you could probably just store those outside of OpenGL... |
From: Prashant S. <ani...@ya...> - 2008-04-19 07:18:51
|
In a 2D application using pyOpenGL where I am not using Depth, there are couple of weired things happenings: When using some off-screen co-ordinates with glRasterPos2f, say my view port is 640x480 where top left is (0,0) and if I am passing (-10,-10) to glRasterPos2f then text goes off even though text is long enough to still appear on screen. When using feedbackBuffer and draw something that is off-screen then I am not getting the results. For example If I am drawing some glPoint where coordinates are inside the viewport area then feedBackBuffer is giving me results other wise I am not able to get the proper results. How can I solve this? Why I need this is because the application is basically a flow chart network where user can connect node's paramaters using curves to show the connections between them. It may possible when using panning, some nodes goes off-screen but still there connection are with some nodes on screen and I am not able to get the positional data of nodes that are off screen. Best regards. ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Mike C. F. <mcf...@vr...> - 2008-04-18 17:12:46
|
Robert Ancell wrote: > Hi, > > I'm the maintainer for glChess in the gnome-games package and we're > having a problem with the name of the GLU error exception class on > Gentoo. > > On my Ubuntu 7.10 box the following works: > >>>> import OpenGL.GLU >>>> OpenGL.GLU.GLUError >>>> > > but on Gentoo it fails, they expect: > >>>> import OpenGL.GLU >>>> OpenGL.GLU.GLUerror >>>> > > What is the correct name for the exception class? > This was an unintentional incompatibility introduced during the 3.x rewrite. I've added the GLUerror alias to PyOpenGL 3.x CVS and it should show up in the next beta release. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-04-18 16:38:55
|
U. Artie Eoff wrote: > I am receiving this error after upgrading my project to use PyOpenGL > 3.0.0b1 (the same code works in version 2.0.2.01): > You are probably seeing an interaction with the code that does the pixel transfer setup. It calls glPixelStorei a number of times to try to set up "normal" transfer for OpenGL calls. You may need to use the OpenGL.raw.GL.glReadPixels temporarily while I try to figure out what's messed up. If you happen to have a test case I can use it's far more likely I'll be able to track down the problem quickly. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-04-18 16:34:58
|
Astan Chee wrote: > Hi, > I have .obj files created by various applications. These .obj files have > tons of material or textures or other things attached to it. Im trying > to strip out all this and only keep the vertices (wireframe) of the > model. Does anyone know how do I do this in python? I've seen > http://www.pygame.org/wiki/OBJFileLoader?parent=CookBook to load .obj > files but how do I just take the vertices/shape and keep a standard > default face/texture for every .obj that I load. > Thanks for any help. > Cheers > Astan > Rewrite the code referenced to comment out the glBindTexture, glColor and glTexCoord2fv calls, set your material/texture before you call the loader. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-04-18 16:30:34
|
Prashant Saxena wrote: > > def drawText(x,y,text): > glRasterPos3f(x,y,0.8) > for i in text: > glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, ord(i)) glutBitmapHeight glutBitmapLength glutBitmapWidth HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Prashant S. <ani...@ya...> - 2008-04-18 13:12:44
|
I am trying to load and draw texture on a polygon. Here are the two functions I have written: textures = [] def loadBitmap(fileName): global textures #load in the file textureSurface = pygame.image.load(fileName) textureData = pygame.image.tostring(textureSurface, "RGBX", 1) #Bind it to a texture textures = glGenTextures(2) glBindTexture(GL_TEXTURE_2D, textures[0]) glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, textureSurface.get_width(), textureSurface.get_height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData ) def drawBitmap(x,y,width,height): global textures glBindTexture(GL_TEXTURE_2D, textures[0]) glBegin(GL_QUADS) glTexCoord2i(0, 0); glVertex2i(x, y) glTexCoord2i(1, 0); glVertex2i(x+width, y) glTexCoord2i(1, 1); glVertex2i(x+width, y+height) glTexCoord2i(0, 1); glVertex2i(x,y+height) glEnd() and in the draw function I am calling 'drawBitmap(400,400,256,256)' the texture file is of 256x256 resolution. The application I am writing here is 2D. There is no depth test. It's disabled. I am getting a gray colored square instead of textured one...? I am using selection/picking on mouse down. When ever I click the gray square flicks...? Rest of the drawing is having no problem at all. In 'loadBitmap' function if I try to load a single texture using 'textures = glGenTextures(1)' I get an error. How do I solve this...? Best regards. Cheers ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Prashant S. <ani...@ya...> - 2008-04-18 13:12:37
|
I am trying to load and draw texture on a polygon. Here are the two functions I have written: textures = [] def loadBitmap(fileName): global textures #load in the file textureSurface = pygame.image.load(fileName) textureData = pygame.image.tostring(textureSurface, "RGBX", 1) #Bind it to a texture textures = glGenTextures(2) glBindTexture(GL_TEXTURE_2D, textures[0]) glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, textureSurface.get_width(), textureSurface.get_height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData ) def drawBitmap(x,y,width,height): global textures glBindTexture(GL_TEXTURE_2D, textures[0]) glBegin(GL_QUADS) glTexCoord2i(0, 0); glVertex2i(x, y) glTexCoord2i(1, 0); glVertex2i(x+width, y) glTexCoord2i(1, 1); glVertex2i(x+width, y+height) glTexCoord2i(0, 1); glVertex2i(x,y+height) glEnd() and in the draw function I am calling 'drawBitmap(400,400,256,256)' the texture file is of 256x256 resolution. The application I am writing here is 2D. There is no depth test. It's disabled. I am getting a gray colored square instead of textured one...? I am using selection/picking on mouse down. When ever I click the gray square flicks...? Rest of the drawing is having no problem at all. In 'loadBitmap' function if I try to load a single texture using 'textures = glGenTextures(1)' I get an error. How do I solve this...? Best regards. Cheers ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Greg E. <gre...@ca...> - 2008-04-17 22:51:56
|
Prashant Saxena wrote: > Everything I am drawing with 'z' less the 1.0 is visible. If I am > drawing something where 'z' is greater then 1.0 it's not visible. You haven't set the near and far clipping depths, so they're defaulting to 0.0 and 1.0. You need to call glOrtho() to set up a projection, e.g. glOrtho(0.0, screen_width, 0.0, screen_height, min_depth, max_depth) where min_depth and max_depth are the range of z coordinates that you intend to use. -- Greg |
From: George P. <gp...@ti...> - 2008-04-17 19:00:47
|
Prashant, glClearDepth() doesn't do what you think it does. Prashant Saxena wrote: > I am creating a 2D application using pyOpenGL. Here is the init function: > glClearColor(0.5, 0.5, 0.5, 0.0) This means, "when you clear the color buffer, make it all gray". > glClearDepth(1.0) > # Enables Clearing Of The Depth Buffer No. This means, "when you clear the depth buffer, make it all 1.0". > Everything I am drawing with 'z' less the 1.0 is visible. Because its z is less than the z value already in the depth buffer (1.0). > If I am > drawing something where 'z' is greater then 1.0 it's not visible. Because its z is greater than the z value already in the depth buffer (1.0), so why bother drawing it? Call glClearDepth() with a more reasonable value (i.e. one that's greater than the depth you'll be drawing anything at) and you should be fine. --George Paci <gp...@ti...> Most software wakes up each day with a fresh case of amnesia. Unfortunately, software that doesn't learn from history dooms users to repeat it. --Bret Victor |
From: Prashant S. <ani...@ya...> - 2008-04-17 18:34:30
|
I am creating a 2D application using pyOpenGL. Here is the init function: glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glEnable(GL_TEXTURE_2D) glEnable(GL_LINE_SMOOTH) glHint(GL_LINE_SMOOTH_HINT, GL_NICEST) glClearColor(0.5, 0.5, 0.5, 0.0) # This Will Clear The Background Color To Black glDepthFunc(GL_LESS) # The Type Of Depth Test To Do glClearDepth(1.0) # Enables Clearing Of The Depth Buffer glEnable(GL_DEPTH_TEST) # Enables Depth Testing glShadeModel(GL_SMOOTH) # Enables Smooth Color Shading glMatrixMode(GL_PROJECTION) glLoadIdentity() # Reset The Projection Matrix gluOrtho2D(0,640,480,0) #This is to make (0,0) at Top-Left glMatrixMode(GL_MODELVIEW) Everything I am drawing with 'z' less the 1.0 is visible. If I am drawing something where 'z' is greater then 1.0 it's not visible. Although I am creating a 2D application but still I need to maintain a depth of my sprites. The sprites are basically a rectangle with some points and text written on it. For this purpose I am thinking to draw every sprite and it's related content between a fix depth, say between 1.0-2.0. Next one will be 2.1-3.0. This way when I drag the sprite they will properly over lap another one. But some how things are not working here. Badly need some tips or suggestions. Cheers ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Sébastien R. <seb...@gm...> - 2008-04-17 08:53:51
|
the 2nd point is only a tips, to compile you just have to launch setup.py instead of launch something like "python setup.py py2exe" ;) Seb Astan Chee a écrit : > Thanks! > Two things I missed: > 1. The import that goes in the beginning of my script goes at the very > beginning before even before the OpenGL imports. > 2. The sys.argv.append('py2exe') in setup.py > Now it works. > Thanks alot! > > Sébastien Ramage wrote: >> this files works for me. >> >> >> Astan Chee a écrit : >>> Yeah, I have both of those. Although Im using >>> setuptools-0.6c8-py2.5.egg >>> >>> >>> >>> Sébastien Ramage wrote: >>>> Do you have put this at the beginning of you script : >>>> import sys >>>> import os >>>> sys.path.insert(0, os.path.join(sys.prefix, "PyOpenGL-3.0.0b1-py2.5.egg")) >>>> sys.path.insert(0, os.path.join(sys.prefix, "setuptools-0.6c7-py2.5.egg")) >>>> >>>> >>>> >>>> >>>> Astan Chee a écrit : >>>>> Yeah, I got them both in the .exe folder. If I didnt, wouldnt >>>>> py2exe not compile the .exe? >>>>> And yes, Im using python 2.5 >>>>> >>>>> Sébastien Ramage wrote: >>>>>> Have you copy the egg? >>>>>> you need to put PyOpenGL-3.0.0b1-py2.5.egg and >>>>>> setuptools-0.6c7-py2.5.egg in the exe folder >>>>>> many be you haven't PyOpenGL-3.0.0b1-py2.5.egg in site-packages, >>>>>> try to download it from Internet >>>>>> http://surfnet.dl.sourceforge.net/sourceforge/pyopengl/PyOpenGL-3.0.0b1-py2.5.egg >>>>>> >>>>>> (I assume you are using Python 2.5) >>>>>> >>>>>> >>>>>> Astan Chee a écrit : >>>>>>> Whops,sorry, my mistake. So many commas, Im so dizzy. >>>>>>> Anyway, now it compiles fine but when I try to run it, it gives me a >>>>>>> >>>>>>> Traceback (most recent call last): >>>>>>> File "script.py", line 1, in <module> >>>>>>> ImportError: No module named OpenGL.GL >>>>>>> >>>>>>> When I try to run the executeable. I tried to copy and paste the >>>>>>> OpenGL folder in site-packages in the python folder and it still >>>>>>> gives me the same error. >>>>>>> Any ideas? I think I have the latest version of these files. >>>>>>> Thanks again. >>>>>>> Astan >>>>>>> >>>>>>> Sébastien Ramage wrote: >>>>>>>> the error is the " , " at the end of options declaration >>>>>>>> this is correct : >>>>>>>> options = {'py2exe':{'excludes':['OpenGL'], >>>>>>>> 'packages':['ctypes','logging','weakref'], >>>>>>>> 'includes':['new','distutils.util'], >>>>>>>> 'bundle_files':1}} >>>>>>>> data_files=[("",["PyOpenGL-3.0.0b1-py2.5.egg"]), >>>>>>>> ("",["setuptools-0.6c7-py2.5.egg"]),] >>>>>>>> >>>>>>>> setup(console=["script.py"],options=options,data_files=data_files) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Astan Chee a écrit : >>>>>>>>> Thanks for that but Im not too familiar with py2exe. >>>>>>>>> This is what my setup looks like: >>>>>>>>> >>>>>>>>> #!/usr/bin/env python >>>>>>>>> from distutils.core import setup >>>>>>>>> import py2exe >>>>>>>>> >>>>>>>>> options = {'py2exe':{'excludes':['OpenGL'], >>>>>>>>> 'packages':['ctypes','logging','weakref'], >>>>>>>>> 'includes':['new','distutils.util'], >>>>>>>>> 'bundle_files':1}}, >>>>>>>>> data_files=[("",["PyOpenGL-3.0.0b1-py2.5.egg"]), >>>>>>>>> ("",["setuptools-0.6c7-py2.5.egg"]),] >>>>>>>>> >>>>>>>>> setup(console=["script.py"],options=options,data_files=data_files) >>>>>>>>> >>>>>>>>> But it gives me the error: >>>>>>>>> >>>>>>>>> Traceback (most recent call last): >>>>>>>>> File "setup.py", line 12, in <module> >>>>>>>>> >>>>>>>>> setup(console=["sol4.py"],options=options,data_files=data_files) >>>>>>>>> File "C:\Python25\lib\distutils\core.py", line 112, in setup >>>>>>>>> _setup_distribution = dist = klass(attrs) >>>>>>>>> File "C:\Python25\lib\site-packages\py2exe\__init__.py", >>>>>>>>> line 80, in __i >>>>>>>>> distutils.dist.Distribution.__init__(self, attrs) >>>>>>>>> File "C:\Python25\lib\distutils\dist.py", line 237, in __init__ >>>>>>>>> for (command, cmd_options) in options.items(): >>>>>>>>> AttributeError: 'tuple' object has no attribute 'items' >>>>>>>>> >>>>>>>>> What am I doing wrong? >>>>>>>>> Thanks again >>>>>>>>> >>>>>>>>> Sébastien Ramage wrote: >>>>>>>>>> Hi ! >>>>>>>>>> I have the same problem and it seems to be a problem with eggs. >>>>>>>>>> I have solved it by copying PyOpenGL-3.0.0b1-py2.5.egg and >>>>>>>>>> setuptools-0.6c7-py2.5.egg in my app directory >>>>>>>>>> and add this on header of my script : >>>>>>>>>> >>>>>>>>>> import sys >>>>>>>>>> import os >>>>>>>>>> sys.path.insert(0, os.path.join(sys.prefix, "PyOpenGL-3.0.0b1-py2.5.egg")) >>>>>>>>>> sys.path.insert(0, os.path.join(sys.prefix, "setuptools-0.6c7-py2.5.egg")) >>>>>>>>>> >>>>>>>>>> and add this in my setup script: >>>>>>>>>> >>>>>>>>>> options = {'py2exe':{'excludes':['OpenGL'], >>>>>>>>>> 'packages':['ctypes','logging','weakref'], >>>>>>>>>> 'includes':['new','distutils.util'], >>>>>>>>>> 'bundle_files':1}}, >>>>>>>>>> data_files=[("",["PyOpenGL-3.0.0b1-py2.5.egg"]), >>>>>>>>>> ("",["setuptools-0.6c7-py2.5.egg"]),], >>>>>>>>>> >>>>>>>>>> Seb >>>>>>>>>> >>>>>>>>>> Astan Chee a écrit : >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> Im trying to make a .exe out of a pygame/pyopengl script using py2exe. >>>>>>>>>>> The headers of my script looks like this: >>>>>>>>>>> import sys >>>>>>>>>>> from OpenGL.GL import * >>>>>>>>>>> from OpenGL.GLU import * >>>>>>>>>>> from OpenGL.arrays import formathandler >>>>>>>>>>> formathandler.FormatHandler.chooseOutput( 'ctypesarrays' ) >>>>>>>>>>> import os, math, random >>>>>>>>>>> import pygame >>>>>>>>>>> from pygame.locals import * >>>>>>>>>>> if sys.platform == 'win32' or sys.platform == 'win64': >>>>>>>>>>> os.environ['SDL_VIDEO_CENTERED'] = '1' >>>>>>>>>>> >>>>>>>>>>> Im using py2exe 0.6.6 and pyopengl 3.0.0b1, and my setup.py file looks >>>>>>>>>>> like this: >>>>>>>>>>> >>>>>>>>>>> #!/usr/bin/env python >>>>>>>>>>> from distutils.core import setup >>>>>>>>>>> import py2exe >>>>>>>>>>> >>>>>>>>>>> setup(console=["script.py"]) >>>>>>>>>>> >>>>>>>>>>> And I can make the .exe fine, but when I try to run the .exe, I keep >>>>>>>>>>> getting this error: >>>>>>>>>>> >>>>>>>>>>> Traceback (most recent call last): >>>>>>>>>>> File "script.py", line 2, in <module> >>>>>>>>>>> File "OpenGL\GL\__init__.pyc", line 2, in <module> >>>>>>>>>>> File "OpenGL\raw\GL\__init__.pyc", line 6, in <module> >>>>>>>>>>> File "OpenGL\raw\GL\constants.pyc", line 7, in <module> >>>>>>>>>>> File "OpenGL\platform\__init__.pyc", line 57, in <module> >>>>>>>>>>> File "OpenGL\platform\__init__.pyc", line 53, in _load >>>>>>>>>>> RuntimeError: Unable to find an implementation for the 'win32' ('nt') >>>>>>>>>>> platform >>>>>>>>>>> >>>>>>>>>>> I've tried various things like copying the openGL folder to the .exe >>>>>>>>>>> folder and such, but it didnt work. What am I doing wrong here? >>>>>>>>>>> Thanks >>>>>>>>>>> Astan >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> ------------------------------------------------------------------------- >>>>>>>>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>>>>>>>> Don't miss this year's exciting event. There's still time to save $100. >>>>>>>>>> Use priority code J8TL2D2. >>>>>>>>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>>>>>>>> _______________________________________________ >>>>>>>>>> Py2exe-users mailing list >>>>>>>>>> Py2...@li... >>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/py2exe-users >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>>>>>>>> >>>>>>>>> <http://www.animallogic.com> >>>>>>>>> >>>>>>>>> Please think of the environment before printing this email. >>>>>>>>> >>>>>>>>> This email and any attachments may be confidential and/or >>>>>>>>> privileged. If you are not the intended recipient of this >>>>>>>>> email, you must not disclose or use the information >>>>>>>>> contained in it. Please notify the sender immediately and >>>>>>>>> delete this document if you have received it in error. We do >>>>>>>>> not guarantee this email is error or virus free. >>>>>>>>> >>>>>>> >>>>>>> -- >>>>>>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>>>>>> >>>>>>> <http://www.animallogic.com> >>>>>>> >>>>>>> Please think of the environment before printing this email. >>>>>>> >>>>>>> This email and any attachments may be confidential and/or >>>>>>> privileged. If you are not the intended recipient of this email, >>>>>>> you must not disclose or use the information >>>>>>> contained in it. Please notify the sender immediately and delete >>>>>>> this document if you have received it in error. We do not >>>>>>> guarantee this email is error or virus free. >>>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> ------------------------------------------------------------------------- >>>>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>>>> Don't miss this year's exciting event. There's still time to save $100. >>>>>> Use priority code J8TL2D2. >>>>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> _______________________________________________ >>>>>> Py2exe-users mailing list >>>>>> Py2...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/py2exe-users >>>>>> >>>>> >>>>> -- >>>>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>>>> >>>>> <http://www.animallogic.com> >>>>> >>>>> Please think of the environment before printing this email. >>>>> >>>>> This email and any attachments may be confidential and/or >>>>> privileged. If you are not the intended recipient of this email, >>>>> you must not disclose or use the information >>>>> contained in it. Please notify the sender immediately and delete >>>>> this document if you have received it in error. We do not >>>>> guarantee this email is error or virus free. >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> ------------------------------------------------------------------------- >>>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>>> Don't miss this year's exciting event. There's still time to save $100. >>>>> Use priority code J8TL2D2. >>>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>>> ------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> Py2exe-users mailing list >>>>> Py2...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/py2exe-users >>>>> >>> >>> -- >>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>> >>> <http://www.animallogic.com> >>> >>> Please think of the environment before printing this email. >>> >>> This email and any attachments may be confidential and/or >>> privileged. If you are not the intended recipient of this email, you >>> must not disclose or use the information >>> contained in it. Please notify the sender immediately and delete >>> this document if you have received it in error. We do not guarantee >>> this email is error or virus free. >>> > > -- > "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." > > <http://www.animallogic.com> > > Please think of the environment before printing this email. > > This email and any attachments may be confidential and/or privileged. > If you are not the intended recipient of this email, you must not > disclose or use the information > contained in it. Please notify the sender immediately and delete this > document if you have received it in error. We do not guarantee this > email is error or virus free. > |
From: Astan C. <st...@al...> - 2008-04-17 08:44:45
|
Thanks! Two things I missed: 1. The import that goes in the beginning of my script goes at the very beginning before even before the OpenGL imports. 2. The sys.argv.append('py2exe') in setup.py Now it works. Thanks alot! Sébastien Ramage wrote: > this files works for me. > > > Astan Chee a écrit : >> Yeah, I have both of those. Although Im using >> setuptools-0.6c8-py2.5.egg >> >> >> >> Sébastien Ramage wrote: >>> Do you have put this at the beginning of you script : >>> import sys >>> import os >>> sys.path.insert(0, os.path.join(sys.prefix, "PyOpenGL-3.0.0b1-py2.5.egg")) >>> sys.path.insert(0, os.path.join(sys.prefix, "setuptools-0.6c7-py2.5.egg")) >>> >>> >>> >>> >>> Astan Chee a écrit : >>>> Yeah, I got them both in the .exe folder. If I didnt, wouldnt >>>> py2exe not compile the .exe? >>>> And yes, Im using python 2.5 >>>> >>>> Sébastien Ramage wrote: >>>>> Have you copy the egg? >>>>> you need to put PyOpenGL-3.0.0b1-py2.5.egg and >>>>> setuptools-0.6c7-py2.5.egg in the exe folder >>>>> many be you haven't PyOpenGL-3.0.0b1-py2.5.egg in site-packages, >>>>> try to download it from Internet >>>>> http://surfnet.dl.sourceforge.net/sourceforge/pyopengl/PyOpenGL-3.0.0b1-py2.5.egg >>>>> >>>>> (I assume you are using Python 2.5) >>>>> >>>>> >>>>> Astan Chee a écrit : >>>>>> Whops,sorry, my mistake. So many commas, Im so dizzy. >>>>>> Anyway, now it compiles fine but when I try to run it, it gives me a >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File "script.py", line 1, in <module> >>>>>> ImportError: No module named OpenGL.GL >>>>>> >>>>>> When I try to run the executeable. I tried to copy and paste the >>>>>> OpenGL folder in site-packages in the python folder and it still >>>>>> gives me the same error. >>>>>> Any ideas? I think I have the latest version of these files. >>>>>> Thanks again. >>>>>> Astan >>>>>> >>>>>> Sébastien Ramage wrote: >>>>>>> the error is the " , " at the end of options declaration >>>>>>> this is correct : >>>>>>> options = {'py2exe':{'excludes':['OpenGL'], >>>>>>> 'packages':['ctypes','logging','weakref'], >>>>>>> 'includes':['new','distutils.util'], >>>>>>> 'bundle_files':1}} >>>>>>> data_files=[("",["PyOpenGL-3.0.0b1-py2.5.egg"]), >>>>>>> ("",["setuptools-0.6c7-py2.5.egg"]),] >>>>>>> >>>>>>> setup(console=["script.py"],options=options,data_files=data_files) >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> Astan Chee a écrit : >>>>>>>> Thanks for that but Im not too familiar with py2exe. >>>>>>>> This is what my setup looks like: >>>>>>>> >>>>>>>> #!/usr/bin/env python >>>>>>>> from distutils.core import setup >>>>>>>> import py2exe >>>>>>>> >>>>>>>> options = {'py2exe':{'excludes':['OpenGL'], >>>>>>>> 'packages':['ctypes','logging','weakref'], >>>>>>>> 'includes':['new','distutils.util'], >>>>>>>> 'bundle_files':1}}, >>>>>>>> data_files=[("",["PyOpenGL-3.0.0b1-py2.5.egg"]), >>>>>>>> ("",["setuptools-0.6c7-py2.5.egg"]),] >>>>>>>> >>>>>>>> setup(console=["script.py"],options=options,data_files=data_files) >>>>>>>> >>>>>>>> But it gives me the error: >>>>>>>> >>>>>>>> Traceback (most recent call last): >>>>>>>> File "setup.py", line 12, in <module> >>>>>>>> >>>>>>>> setup(console=["sol4.py"],options=options,data_files=data_files) >>>>>>>> File "C:\Python25\lib\distutils\core.py", line 112, in setup >>>>>>>> _setup_distribution = dist = klass(attrs) >>>>>>>> File "C:\Python25\lib\site-packages\py2exe\__init__.py", line >>>>>>>> 80, in __i >>>>>>>> distutils.dist.Distribution.__init__(self, attrs) >>>>>>>> File "C:\Python25\lib\distutils\dist.py", line 237, in __init__ >>>>>>>> for (command, cmd_options) in options.items(): >>>>>>>> AttributeError: 'tuple' object has no attribute 'items' >>>>>>>> >>>>>>>> What am I doing wrong? >>>>>>>> Thanks again >>>>>>>> >>>>>>>> Sébastien Ramage wrote: >>>>>>>>> Hi ! >>>>>>>>> I have the same problem and it seems to be a problem with eggs. >>>>>>>>> I have solved it by copying PyOpenGL-3.0.0b1-py2.5.egg and >>>>>>>>> setuptools-0.6c7-py2.5.egg in my app directory >>>>>>>>> and add this on header of my script : >>>>>>>>> >>>>>>>>> import sys >>>>>>>>> import os >>>>>>>>> sys.path.insert(0, os.path.join(sys.prefix, "PyOpenGL-3.0.0b1-py2.5.egg")) >>>>>>>>> sys.path.insert(0, os.path.join(sys.prefix, "setuptools-0.6c7-py2.5.egg")) >>>>>>>>> >>>>>>>>> and add this in my setup script: >>>>>>>>> >>>>>>>>> options = {'py2exe':{'excludes':['OpenGL'], >>>>>>>>> 'packages':['ctypes','logging','weakref'], >>>>>>>>> 'includes':['new','distutils.util'], >>>>>>>>> 'bundle_files':1}}, >>>>>>>>> data_files=[("",["PyOpenGL-3.0.0b1-py2.5.egg"]), >>>>>>>>> ("",["setuptools-0.6c7-py2.5.egg"]),], >>>>>>>>> >>>>>>>>> Seb >>>>>>>>> >>>>>>>>> Astan Chee a écrit : >>>>>>>>> >>>>>>>>>> Hi, >>>>>>>>>> Im trying to make a .exe out of a pygame/pyopengl script using py2exe. >>>>>>>>>> The headers of my script looks like this: >>>>>>>>>> import sys >>>>>>>>>> from OpenGL.GL import * >>>>>>>>>> from OpenGL.GLU import * >>>>>>>>>> from OpenGL.arrays import formathandler >>>>>>>>>> formathandler.FormatHandler.chooseOutput( 'ctypesarrays' ) >>>>>>>>>> import os, math, random >>>>>>>>>> import pygame >>>>>>>>>> from pygame.locals import * >>>>>>>>>> if sys.platform == 'win32' or sys.platform == 'win64': >>>>>>>>>> os.environ['SDL_VIDEO_CENTERED'] = '1' >>>>>>>>>> >>>>>>>>>> Im using py2exe 0.6.6 and pyopengl 3.0.0b1, and my setup.py file looks >>>>>>>>>> like this: >>>>>>>>>> >>>>>>>>>> #!/usr/bin/env python >>>>>>>>>> from distutils.core import setup >>>>>>>>>> import py2exe >>>>>>>>>> >>>>>>>>>> setup(console=["script.py"]) >>>>>>>>>> >>>>>>>>>> And I can make the .exe fine, but when I try to run the .exe, I keep >>>>>>>>>> getting this error: >>>>>>>>>> >>>>>>>>>> Traceback (most recent call last): >>>>>>>>>> File "script.py", line 2, in <module> >>>>>>>>>> File "OpenGL\GL\__init__.pyc", line 2, in <module> >>>>>>>>>> File "OpenGL\raw\GL\__init__.pyc", line 6, in <module> >>>>>>>>>> File "OpenGL\raw\GL\constants.pyc", line 7, in <module> >>>>>>>>>> File "OpenGL\platform\__init__.pyc", line 57, in <module> >>>>>>>>>> File "OpenGL\platform\__init__.pyc", line 53, in _load >>>>>>>>>> RuntimeError: Unable to find an implementation for the 'win32' ('nt') >>>>>>>>>> platform >>>>>>>>>> >>>>>>>>>> I've tried various things like copying the openGL folder to the .exe >>>>>>>>>> folder and such, but it didnt work. What am I doing wrong here? >>>>>>>>>> Thanks >>>>>>>>>> Astan >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> ------------------------------------------------------------------------- >>>>>>>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>>>>>>> Don't miss this year's exciting event. There's still time to save $100. >>>>>>>>> Use priority code J8TL2D2. >>>>>>>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>>>>>>> _______________________________________________ >>>>>>>>> Py2exe-users mailing list >>>>>>>>> Py2...@li... >>>>>>>>> https://lists.sourceforge.net/lists/listinfo/py2exe-users >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>>>>>>> >>>>>>>> <http://www.animallogic.com> >>>>>>>> >>>>>>>> Please think of the environment before printing this email. >>>>>>>> >>>>>>>> This email and any attachments may be confidential and/or >>>>>>>> privileged. If you are not the intended recipient of this >>>>>>>> email, you must not disclose or use the information >>>>>>>> contained in it. Please notify the sender immediately and >>>>>>>> delete this document if you have received it in error. We do >>>>>>>> not guarantee this email is error or virus free. >>>>>>>> >>>>>> >>>>>> -- >>>>>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>>>>> >>>>>> <http://www.animallogic.com> >>>>>> >>>>>> Please think of the environment before printing this email. >>>>>> >>>>>> This email and any attachments may be confidential and/or >>>>>> privileged. If you are not the intended recipient of this email, >>>>>> you must not disclose or use the information >>>>>> contained in it. Please notify the sender immediately and delete >>>>>> this document if you have received it in error. We do not >>>>>> guarantee this email is error or virus free. >>>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> ------------------------------------------------------------------------- >>>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>>> Don't miss this year's exciting event. There's still time to save $100. >>>>> Use priority code J8TL2D2. >>>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>>> ------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> Py2exe-users mailing list >>>>> Py2...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/py2exe-users >>>>> >>>> >>>> -- >>>> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >>>> >>>> <http://www.animallogic.com> >>>> >>>> Please think of the environment before printing this email. >>>> >>>> This email and any attachments may be confidential and/or >>>> privileged. If you are not the intended recipient of this email, >>>> you must not disclose or use the information >>>> contained in it. Please notify the sender immediately and delete >>>> this document if you have received it in error. We do not guarantee >>>> this email is error or virus free. >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>>> Don't miss this year's exciting event. There's still time to save $100. >>>> Use priority code J8TL2D2. >>>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>>> ------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Py2exe-users mailing list >>>> Py2...@li... >>>> https://lists.sourceforge.net/lists/listinfo/py2exe-users >>>> >> >> -- >> "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." >> >> <http://www.animallogic.com> >> >> Please think of the environment before printing this email. >> >> This email and any attachments may be confidential and/or privileged. >> If you are not the intended recipient of this email, you must not >> disclose or use the information >> contained in it. Please notify the sender immediately and delete this >> document if you have received it in error. We do not guarantee this >> email is error or virus free. >> -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free. |
From: Prashant S. <ani...@ya...> - 2008-04-16 18:41:13
|
def drawText(x,y,text): glRasterPos3f(x,y,0.8) for i in text: glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, ord(i)) when creating a text using above function how do I determine the bounding box of the text drawn or the length taken by the text? ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ |
From: Astan C. <st...@al...> - 2008-04-15 07:19:59
|
Hi, I have .obj files created by various applications. These .obj files have tons of material or textures or other things attached to it. Im trying to strip out all this and only keep the vertices (wireframe) of the model. Does anyone know how do I do this in python? I've seen http://www.pygame.org/wiki/OBJFileLoader?parent=CookBook to load .obj files but how do I just take the vertices/shape and keep a standard default face/texture for every .obj that I load. Thanks for any help. Cheers Astan -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free. |
From: altern <al...@gm...> - 2008-04-11 08:24:40
|
hi! under linux and it works fine, it runs very smooth. enrike Prashant Saxena(e)k dio: > > Hi, > > This is my first try with pyOpenGL and I have created a simple scene > graph for selection,dragging,marquee selection etc. I am not sure if > it's done in correct way. > > The problem is simple : When I resize the window and drag the squares, > the movement is not smooth. It kind of flicks. The file is attached. > Please send me suggestion/opinions or if anything wrong other then > mentioned. > > Cheers > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > > > ------------------------------------------------------------------------ > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users |
From: Prashant S. <ani...@ya...> - 2008-04-11 08:01:41
|
Hi, This is my first try with pyOpenGL and I have created asimple scene graph for selection,dragging,marquee selection etc. I amnot sure if it's done in correct way. The problem is simple :When I resize the window and drag the squares, the movement is notsmooth. It kind of flicks. The file is attached. Please send me suggestion/opinions or if anything wrong other then mentioned. Cheers __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: U. A. E. <ar...@cd...> - 2008-04-09 15:29:54
|
I am receiving this error after upgrading my project to use PyOpenGL 3.0.0b1 (the same code works in version 2.0.2.01): ######################################## Traceback (most recent call last): File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14099, in <lambda> lambda event: event.callable(*event.args, **event.kw) ) File "C:\bicspe\construct\python\src\cdr\cellsim\clients\gui\OpenGLRenderer.py", line 933, in EventUpdate tr.endTile() File "C:\bicspe\construct\python\src\cdr\cellsim\clients\gui\TileRenderer.py", line 118, in endTile data = array(GL.glReadPixelsub(0, 0, width, height, GL.GL_RGB)) File "C:\Python25\lib\site-packages\pyopengl-3.0.0b1-py2.5.egg\OpenGL\GL\images.py", line 233, in glReadPixels ctypes.c_void_p( imageData ) WindowsError: exception: access violation writing 0x00000000 ######################################### Of course, the error shown occurs on windows xp... however, it segmentation faults on Mac OSX and Fedora 8 in the same location. Basically, I am doing a large opengl capture using tile rendering. Here is my class function where the error occurs: <div> ######################################### def endTile(self): GL.glFlush() prevRowLength = GL.glGetIntegerv(GL.GL_PACK_ROW_LENGTH) prevSkipRows = GL.glGetIntegerv(GL.GL_PACK_SKIP_ROWS) prevSkipPixels = GL.glGetIntegerv(GL.GL_PACK_SKIP_PIXELS) destX = self.tileWidth * self.currentColumn destY = self.tileHeight * self.currentRow GL.glPixelStorei(GL.GL_PACK_ROW_LENGTH, int(self.imageWidth)) GL.glPixelStorei(GL.GL_PACK_SKIP_ROWS, int(destY)) GL.glPixelStorei(GL.GL_PACK_SKIP_PIXELS, int(destX)) width = self.tileWidth height = self.tileHeight #grab only the pixels we need on the edges if self.currentRow == self.rows - 1 and self.tileHeightEdge: height = self.tileHeightEdge if self.currentColumn == self.columns - 1 and self.tileWidthEdge: width = self.tileWidthEdge data = array(GL.glReadPixelsub(0, 0, width, height, GL.GL_RGB)) GL.glPixelStorei(GL.GL_PACK_ROW_LENGTH, int(prevRowLength)) GL.glPixelStorei(GL.GL_PACK_SKIP_ROWS, int(prevSkipRows)) GL.glPixelStorei(GL.GL_PACK_SKIP_PIXELS, int(prevSkipPixels)) self.currentTile += 1 if self.currentTile > self.rows * self.columns: GL.glViewport(self.viewportSave[0], self.viewportSave[1], self.viewportSave[2], self.viewportSave[3]) self.currentTile = -1 else: GL.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1) image = Image.fromstring("RGB", (width, height), data.tostring()) self.image.paste(image, (destX, destY)) ######################################### </div> If I comment out all the GL.glPixelStorei(GL.GL_PACK_ROW_LENGTH, ...), GL.glPixelStorei(GL.GL_PACK_SKIP_ROWS, ...), and GL.glPixelStorei(GL.GL_PACK_SKIP_PIXELS, ...) calls, the error DISAPPEARS on all platforms mentioned above; however, the end result that I seek is not right. Is this a known bug or does anyone have a workaround? Thanks, U. Artie Eoff |
From: <ar...@cd...> - 2008-04-09 01:52:54
|
I am receiving this error after upgrading my project to use PyOpenGL 3.0.0b1 (the same code works in version 2.0.2.01): ######################################## Traceback (most recent call last): File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14099, in <lambda> lambda event: event.callable(*event.args, **event.kw) ) File "C:\bicspe\construct\python\src\cdr\cellsim\clients\gui\OpenGLRenderer.py", line 933, in EventUpdate tr.endTile() File "C:\bicspe\construct\python\src\cdr\cellsim\clients\gui\TileRenderer.py", line 118, in endTile data = array(GL.glReadPixelsub(0, 0, width, height, GL.GL_RGB)) File "C:\Python25\lib\site-packages\pyopengl-3.0.0b1-py2.5.egg\OpenGL\GL\images.py", line 233, in glReadPixels ctypes.c_void_p( imageData ) WindowsError: exception: access violation writing 0x00000000 ######################################### Of course, the error shown occurs on windows xp... however, it segmentation faults on Mac OSX and Fedora 8 in the same location. Basically, I am doing a large opengl capture using tile rendering. Here is my class function where the error occurs: <div> ######################################### def endTile(self): GL.glFlush() prevRowLength = GL.glGetIntegerv(GL.GL_PACK_ROW_LENGTH) prevSkipRows = GL.glGetIntegerv(GL.GL_PACK_SKIP_ROWS) prevSkipPixels = GL.glGetIntegerv(GL.GL_PACK_SKIP_PIXELS) destX = self.tileWidth * self.currentColumn destY = self.tileHeight * self.currentRow GL.glPixelStorei(GL.GL_PACK_ROW_LENGTH, int(self.imageWidth)) GL.glPixelStorei(GL.GL_PACK_SKIP_ROWS, int(destY)) GL.glPixelStorei(GL.GL_PACK_SKIP_PIXELS, int(destX)) width = self.tileWidth height = self.tileHeight #grab only the pixels we need on the edges if self.currentRow == self.rows - 1 and self.tileHeightEdge: height = self.tileHeightEdge if self.currentColumn == self.columns - 1 and self.tileWidthEdge: width = self.tileWidthEdge data = array(GL.glReadPixelsub(0, 0, width, height, GL.GL_RGB)) GL.glPixelStorei(GL.GL_PACK_ROW_LENGTH, int(prevRowLength)) GL.glPixelStorei(GL.GL_PACK_SKIP_ROWS, int(prevSkipRows)) GL.glPixelStorei(GL.GL_PACK_SKIP_PIXELS, int(prevSkipPixels)) self.currentTile += 1 if self.currentTile > self.rows * self.columns: GL.glViewport(self.viewportSave[0], self.viewportSave[1], self.viewportSave[2], self.viewportSave[3]) self.currentTile = -1 else: GL.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1) image = Image.fromstring("RGB", (width, height), data.tostring()) self.image.paste(image, (destX, destY)) ######################################### </div> If I comment out all the GL.glPixelStorei(GL.GL_PACK_ROW_LENGTH, ...), GL.glPixelStorei(GL.GL_PACK_SKIP_ROWS, ...), and GL.glPixelStorei(GL.GL_PACK_SKIP_PIXELS, ...) calls, the error DISAPPEARS on all platforms mentioned above; however, the end result that I seek is not right. |
From: Astan C. <st...@al...> - 2008-04-08 08:13:07
|
Hi, Thanks for these tips. It worked. I didnt know I had to do a blend. Thanks again. Cheers Astan Gary Herron wrote: > Astan Chee wrote: >> Hi, >> Im trying to make this: >> >> green = (( 0.0, 1.0, 0.0, 1 )) >> glColor4f( 0, 1, 0, .1 ) >> glBegin( GL_POLYGON ) >> glMaterialfv( GL_FRONT, GL_EMISSION, green ) >> rad = 0.5 >> for i in xrange(0,360,5): >> glVertex3f(x1+math.sin(i*math.pi/180.0)*rad , >> y1+math.cos(i*math.pi/180.0)*rad,z1) glEnd( ) >> >> to be opaque. I read that the last part of glColor4f() allows alpha >> channels for transparency levels. I changed it and it still remains >> solid. What am I doing wrong? >> Thanks again for any help. >> Cheers >> Astan >> >> > Several things wrong there: > > First, you must enable blending with > glEnable(GL_BLEND) > before the glBegin and you should disable it with > glDisable(GL_BLEND) > after the glEnd. > > Second, you are mixing two ways of specifying color. Choose one of > these: > > Choice 1: Using glColor > Choose this method with glDisable(GL_LIGHTING) > Specify color per vertex with any of the glColorXX routines. > > Choice 2: Using Phong lighting > Choose this method with glEnable(GL_LIGHTING) > For lighting to work, you must also specify the light's position/color > and other properties with glLight, > as well as the surface properties (diffuse/specula/shininess/ ...) per > vertex with glMaterial. > > (There is a third method where values specified with glColor affect > lighting values normally specified via glMaterial. It uses the > glColorMaterial calls. Call this mode advance, and ignore it for now.) > > Either method of specifying color can specify RGBA > (red,green,blue,alpha) values. If the alpha value is not equal to 1 > and GL_BLEND is enabled, you will get blending. In order for that > blending to look like transparency, you must make sure to draw the > background first, without blending enabled, then draw the transparent > object with blending enabled. > > The last piece of the puzzle is to specify how you want the > transparent color to be combined the the existing background color. > This is done with > glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) > when you enable blending (or earlier). > > Gary Herron > > > > -- "Formulations of number theory: Complete, Consistent, Non-trivial. Choose two." Animal Logic http://www.animallogic.com Please think of the environment before printing this email. This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free. |