pyopengl-users Mailing List for PyOpenGL (Page 69)
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: shirish a. <shi...@gm...> - 2007-04-26 07:36:13
|
Hi all, Is it possible to have a single .exe file which has all the deps built into into it. The latest one is http://sourceforge.net/project/showfiles.php?group_id=5988&package_id=6035pyopengl 3.0a6 but there is no .exe just .zip which one has to build. I wanted to play the games done at pyweek.org but the trouble in order to get thngs running seems to be quite a bit. Any idea when an pre-compiled binary be ready. The installation instructions at http://pyopengl.sourceforge.net/documentation/installation.html which give instructions of installing PyOpenGL 2.0.1 goes far back to 2k1. Do u guys have a wiki, while at the same time any ideas when a beta would be available so end-users like me who want to play games can do it without going to install atleast 3-4 other stuff. I know I may be sounding stupid but still its a plea from a no-brainer gamer :) -- Shirish Agarwal This work is licensed under the Creative Commons NonCommercial Sampling Plus 1.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/nc-sampling+/1.0/ |
From: Rodney S. <rod...@gm...> - 2007-04-18 00:30:46
|
I have some visualization software running on python24 using an older version of pyopengl. I have been upgrading to python25 and one thing missing is the gle library. I notice that the demos for this dont work either. The code needs a gle32.dll which is loaded in platform/win32 try: GLE = ctypesloader.loadLibrary( ctypes.cdll, 'gle32' ) GLE.FunctionType = ctypes.CFUNCTYPE Hunting around for this I find mcfletch in his blog saying "GLE DLL is a PITA" and talks about having a batch file to compile this, however I have not been able to track this down in the source... I have the gle source distribution and can compile the lib file, however it looks like I have to link in with the glut library as well to make a dll. Any suggestions as to where this might be found? Or anyone got a precompiled version? Thanx in advance |
From: Sean Ross-R. <sro...@gm...> - 2007-04-14 21:01:03
|
Hi, I am new to working in PyOpenGL. I want to take a C++ class and extend it to python, but I don't know how to link with openGL. I get the error: _________________________________________________________________ ImportError: Failure linking new module: vally.so: Symbol not found: _glVertex3f Referenced from: vally.so Expected in: dynamic lookup _________________________________________________________________ I am using an intel mac and used the commands: _________________________________________________________________ gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused- madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/boost/ -I/sw/ include/python2.4 -c boost_val.cpp -o build/boost_val.o gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused- madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/boost/ -I/sw/ include/python2.4 -c val.cpp -o build/val.o c++ -L/sw/lib -bundle -undefined dynamic_lookup build/boost_val.o build/val.o -L/sw/lib -lboost_python -o build/vally.so -framework OpenGL -framework GLUT _________________________________________________________________ do you have any advice? Thank you, ~Sean |
From: Erik J. <ejo...@fa...> - 2007-04-11 21:14:09
|
On Wed, 11 Apr 2007 14:48:35 +0100, "Krystian Samp" said: > Hi, > Has anyone managed to use VBO vertex and element arrays together? I have successfully used Vertex Arrays with PyOpenGL, but not Vertex Buffer Objects. There is a post here saying that VBOs sort of work with PyOpenGL 3. http://blog.vrplumber.com/1745 That probably doesn't help much, but that's all I know about VBOs. Erik |
From: Krystian S. <sam...@gm...> - 2007-04-11 13:48:38
|
Hi, Has anyone managed to use VBO vertex and element arrays together? I think I'm doing something wrong maybe with defining python arrays of vertices and indices. Moreover, Some functions require a parameter defining what is the size of the unit of data, e.g. GL_UNSIGNED_INT, GL_INT, GL_UNSIGNED_SHORT etc. - this is also a possible place of error. I know about lesson45.py but it's using only vertex array. Does anyone have examples, advices, comments? Best Regards, Krystian |
From: Krystian S. <sam...@gm...> - 2007-04-11 13:36:33
|
Hi, I'm trying to use shaders in PyOpenGL. When I installed the newest version of PyOpenGL (a6) i got new error message, so I'm not even able to describe my main problem at the moment. File "C:\Python25\Lib\site-packages\pyopengl- 3.0.0a6-py2.5.egg\OpenGL\GL\ARB\shader_objects_new.py", line 8, in <module> ImportError: cannot import name finalisewrappers It seems that finalisewrappers.py module is missing in the distribution. Best Regards, Krystian |
From: Allan W. <ky...@ho...> - 2007-03-30 19:10:31
|
Hi, I'm new to all this, so please excuse my ignorance. I've been provided with some sample C code which displays a windmill with rotating sails. As a personal learning exercise, I tried to translate the C code to Python. It sort of works as expected, but I'm getting some weird effects - there appears to be 'holes' in the base of the windmill. Using the L and R keys to rotate the mounting also reveals holes in its faces. It's quite hard for me to describe, much easier to see it for yourself. It might be a simple error I've made in translating the code, but I've checked it over and can't see anything obviously wrong. Any help would be much appreciated. I've uploaded the code so if anyone wants to help, they can. C code: http://www.divshare.com/download/310430-b64 Python code: http://www.divshare.com/download/310431-f61 Thanks in advance _________________________________________________________________ Txt a lot? Get Messenger FREE on your mobile. https://livemessenger.mobile.uk.msn.com/ |
From: Jason R. <ja...@il...> - 2007-03-29 18:45:00
|
yes PIL works great, this is how i've done it: def loadImage(imageName): from Image import open im = open(imageName) try: ix, iy = im.size[0], im.size[1] image = im.tostring("raw", "RGBA", 0, -1) except SystemError: ix, iy = im.size[0], im.size[1] image = im.tostring("raw", "RGBX", 0, -1) return ix, iy, image def createTexture(imageName): w, h, image = loadImage(imageName) id = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, id); glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image) return id Andrew Wilson wrote: > You may want to give PIL a shot. > http://www.pythonware.com/products/pil/ > Thanks > Andrew > > > > > > On 3/29/07, * Matthew Morris* <mj...@ms... > <mailto:mj...@ms...>> wrote: > > Maybe make a new buffer: RGB_RGB_RGB_..... and fill in the blanks > with the data from GetAlpha(). But there might be a better way, who > knows. > > -Matt > > > On 3/29/07, * altern* <al...@gm... <mailto:al...@gm...>> > wrote: > > you are right i just discovered that. I can see as well that > there is a > way to get the alpha info > image.GetAlpha() > but i am not sure how to use this two different types of data to > construct a valid opengl texture with alpha. > > Matthew Morris(e)k dio: >> Doesn't image.GetData () return RGB, and not RGBA, data? >> >> On 3/29/07, *altern* <al...@gm... > <mailto:al...@gm...> <mailto: al...@gm... > <mailto:al...@gm...>>> wrote: >> >> thanks andrew, i dont know how i did not find this myself, > i was >> looking in >> wxBitmap class for this type of function. >> still i dont get the images properly displayed. I can see > it has similar >> colors as the original but it is heavily pixelated. Is > there any >> difference in the format of the image data array itself > between wx and >> pygame? >> >> Andrew Wilson(e)k dio: >> > Hello, >> > You may want to try, >> > >> > bin = image.GetData() >> > >> > >> > Thanks >> > andrew >> > >> > >> > >> > On 3/29/07, *altern* < al...@gm... > <mailto:al...@gm...> >> <mailto: al...@gm... <mailto:al...@gm...>> > <mailto: al...@gm... <mailto:al...@gm...> >> <mailto: al...@gm... <mailto:al...@gm...>>>> wrote: >> > >> > hi >> > >> > I am trying to translate a pygame+opengl application to >> wx+opengl. >> > And I >> > am stuck at the function to import images to create > OpenGL >> textures. >> > >> > I already asked for help on the wxpython list, but > nobody >> seemed to be >> > interested on my problem, so i thought there might > be some >> wx-pyopengl >> > users in the pyopengl list. >> > >> > This is the pygame code: >> > >> > surface = pygame.image.load(path) >> > if surface.get_alpha is None: >> > surface = surface.convert () >> > else: >> > surface = surface.convert_alpha () >> > bin = pygame.image.tostring(surface, "RGBA", 1) >> > w, h = surface.get_width(), surface.get_height() >> > textid = glGenTextures(1) >> > glBindTexture(GL_TEXTURE_2D, textid) >> > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, >> GL_UNSIGNED_BYTE, >> > bin) >> > ... and so on ... >> > >> > and this is the wx code i am using : >> > >> > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) >> > bin = image.ConvertToBitmap() >> > w,h = image.GetWidth(), image.GetHeight() >> > textid = glGenTextures(1) >> > glBindTexture(GL_TEXTURE_2D, textid) >> > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, >> GL_UNSIGNED_BYTE, >> > bin) >> > ... etc ... >> > >> > It doesnt crash but the texture that OpenGL displays > in not >> at all the >> > image i am importing but some weird random colors. I > guess >> this is the >> > bit that i am missing, since printing >> "image.ConvertToBitmap()" returns >> > a wxBitmap instance and not the image data >> > bin = pygame.image.tostring(surface, "RGBA", 1) >> > >> > I have been trying to find out how to access the data an >> looking for >> > examples on the net but did not find anything. >> > >> > any tips? thanks! >> > >> > enrike >> > >> > >> > >> > ------------------------------------------------------------------------- > >> > Take Surveys. Earn Cash. Influence the Future of IT >> > Join SourceForge.net's Techsay panel and you'll get the >> chance to >> > share your >> > opinions on IT & business topics through brief > surveys-and >> earn cash >> > >> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> >> > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>> >> > >> > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> >> < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>>> >> > _______________________________________________ >> > PyOpenGL Homepage >> > http://pyopengl.sourceforge.net < > http://pyopengl.sourceforge.net> >> > _______________________________________________ >> > PyOpenGL-Users mailing list >> > PyO...@li... > <mailto:PyO...@li...> >> <mailto: PyO...@li... > <mailto:PyO...@li...>> >> > <mailto: PyO...@li... > <mailto:PyO...@li...> >> <mailto: PyO...@li... > <mailto:PyO...@li...>>> >> > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > <https://lists.sourceforge.net/lists/listinfo/pyopengl-users> >> > >> > >> >> >> >> > ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net 's Techsay panel and you'll get the > chance to >> share your >> opinions on IT & business topics through brief surveys-and > earn cash >> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> >> < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>> >> _______________________________________________ >> PyOpenGL Homepage >> http://pyopengl.sourceforge.net >> _______________________________________________ >> PyOpenGL-Users mailing list >> PyO...@li... > <mailto:PyO...@li...> >> <mailto: PyO...@li... > <mailto:PyO...@li...>> >> https://lists.sourceforge.net/lists/listinfo/pyopengl-users > <https://lists.sourceforge.net/lists/listinfo/pyopengl-users> >> >> >> >> > ------------------------------------------------------------------------ > >> >> > ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance > to share your >> opinions on IT & business topics through brief surveys-and > earn cash >> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> >> >> >> > ------------------------------------------------------------------------ >> >> _______________________________________________ >> PyOpenGL Homepage >> http://pyopengl.sourceforge.net >> _______________________________________________ >> PyOpenGL-Users mailing list >> PyO...@li... > <mailto:PyO...@li...> >> https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance > to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > <https://lists.sourceforge.net/lists/listinfo/pyopengl-users> > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > <https://lists.sourceforge.net/lists/listinfo/pyopengl-users> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users |
From: Andrew W. <and...@al...> - 2007-03-29 18:19:34
|
You may want to give PIL a shot. http://www.pythonware.com/products/pil/ Thanks Andrew On 3/29/07, Matthew Morris <mj...@ms...> wrote: > > Maybe make a new buffer: RGB_RGB_RGB_..... and fill in the blanks with > the data from GetAlpha(). But there might be a better way, who knows. > > -Matt > > On 3/29/07, altern <al...@gm...> wrote: > > > > you are right i just discovered that. I can see as well that there is a > > way to get the alpha info > > image.GetAlpha() > > but i am not sure how to use this two different types of data to > > construct a valid opengl texture with alpha. > > > > Matthew Morris(e)k dio: > > > Doesn't image.GetData () return RGB, and not RGBA, data? > > > > > > On 3/29/07, *altern* <al...@gm... <mailto:al...@gm...>> > > wrote: > > > > > > thanks andrew, i dont know how i did not find this myself, i was > > > looking in > > > wxBitmap class for this type of function. > > > still i dont get the images properly displayed. I can see it has > > similar > > > colors as the original but it is heavily pixelated. Is there any > > > difference in the format of the image data array itself between wx > > and > > > pygame? > > > > > > Andrew Wilson(e)k dio: > > > > Hello, > > > > You may want to try, > > > > > > > > bin = image.GetData() > > > > > > > > > > > > Thanks > > > > andrew > > > > > > > > > > > > > > > > On 3/29/07, *altern* < al...@gm... > > > <mailto:al...@gm...> <mailto: al...@gm... > > > <mailto:al...@gm...>>> wrote: > > > > > > > > hi > > > > > > > > I am trying to translate a pygame+opengl application to > > > wx+opengl. > > > > And I > > > > am stuck at the function to import images to create OpenGL > > > textures. > > > > > > > > I already asked for help on the wxpython list, but nobody > > > seemed to be > > > > interested on my problem, so i thought there might be some > > > wx-pyopengl > > > > users in the pyopengl list. > > > > > > > > This is the pygame code: > > > > > > > > surface = pygame.image.load(path) > > > > if surface.get_alpha is None: > > > > surface = surface.convert () > > > > else: > > > > surface = surface.convert_alpha () > > > > bin = pygame.image.tostring(surface, "RGBA", 1) > > > > w, h = surface.get_width(), surface.get_height() > > > > textid = glGenTextures(1) > > > > glBindTexture(GL_TEXTURE_2D, textid) > > > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, > > > GL_UNSIGNED_BYTE, > > > > bin) > > > > ... and so on ... > > > > > > > > and this is the wx code i am using : > > > > > > > > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) > > > > bin = image.ConvertToBitmap() > > > > w,h = image.GetWidth(), image.GetHeight() > > > > textid = glGenTextures(1) > > > > glBindTexture(GL_TEXTURE_2D, textid) > > > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, > > > GL_UNSIGNED_BYTE, > > > > bin) > > > > ... etc ... > > > > > > > > It doesnt crash but the texture that OpenGL displays in not > > > at all the > > > > image i am importing but some weird random colors. I guess > > > this is the > > > > bit that i am missing, since printing > > > "image.ConvertToBitmap()" returns > > > > a wxBitmap instance and not the image data > > > > bin = pygame.image.tostring(surface, "RGBA", 1) > > > > > > > > I have been trying to find out how to access the data an > > > looking for > > > > examples on the net but did not find anything. > > > > > > > > any tips? thanks! > > > > > > > > enrike > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > Take Surveys. Earn Cash. Influence the Future of IT > > > > Join SourceForge.net's Techsay panel and you'll get the > > > chance to > > > > share your > > > > opinions on IT & business topics through brief surveys-and > > > earn cash > > > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > < > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > > > > > < > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > >> > > > > _______________________________________________ > > > > PyOpenGL Homepage > > > > http://pyopengl.sourceforge.net < > > http://pyopengl.sourceforge.net> > > > > _______________________________________________ > > > > PyOpenGL-Users mailing list > > > > PyO...@li... > > > <mailto: PyO...@li...> > > > > <mailto: PyO...@li... > > > <mailto: PyO...@li...>> > > > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net 's Techsay panel and you'll get the chance to > > > share your > > > opinions on IT & business topics through brief surveys-and earn > > cash > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > _______________________________________________ > > > PyOpenGL Homepage > > > http://pyopengl.sourceforge.net > > > _______________________________________________ > > > PyOpenGL-Users mailing list > > > PyO...@li... > > > <mailto: PyO...@li...> > > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to > > share your > > > opinions on IT & business topics through brief surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > PyOpenGL Homepage > > > http://pyopengl.sourceforge.net > > > _______________________________________________ > > > PyOpenGL-Users mailing list > > > PyO...@li... > > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > ------------------------------------------------------------------------- > > > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > your > > opinions on IT & business topics through brief surveys-and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > |
From: Matthew M. <mj...@ms...> - 2007-03-29 18:01:18
|
Maybe make a new buffer: RGB_RGB_RGB_..... and fill in the blanks with the data from GetAlpha(). But there might be a better way, who knows. -Matt On 3/29/07, altern <al...@gm...> wrote: > > you are right i just discovered that. I can see as well that there is a > way to get the alpha info > image.GetAlpha() > but i am not sure how to use this two different types of data to > construct a valid opengl texture with alpha. > > Matthew Morris(e)k dio: > > Doesn't image.GetData() return RGB, and not RGBA, data? > > > > On 3/29/07, *altern* <al...@gm... <mailto:al...@gm...>> > wrote: > > > > thanks andrew, i dont know how i did not find this myself, i was > > looking in > > wxBitmap class for this type of function. > > still i dont get the images properly displayed. I can see it has > similar > > colors as the original but it is heavily pixelated. Is there any > > difference in the format of the image data array itself between wx > and > > pygame? > > > > Andrew Wilson(e)k dio: > > > Hello, > > > You may want to try, > > > > > > bin = image.GetData() > > > > > > > > > Thanks > > > andrew > > > > > > > > > > > > On 3/29/07, *altern* < al...@gm... > > <mailto:al...@gm...> <mailto:al...@gm... > > <mailto:al...@gm...>>> wrote: > > > > > > hi > > > > > > I am trying to translate a pygame+opengl application to > > wx+opengl. > > > And I > > > am stuck at the function to import images to create OpenGL > > textures. > > > > > > I already asked for help on the wxpython list, but nobody > > seemed to be > > > interested on my problem, so i thought there might be some > > wx-pyopengl > > > users in the pyopengl list. > > > > > > This is the pygame code: > > > > > > surface = pygame.image.load(path) > > > if surface.get_alpha is None: > > > surface = surface.convert () > > > else: > > > surface = surface.convert_alpha () > > > bin = pygame.image.tostring(surface, "RGBA", 1) > > > w, h = surface.get_width(), surface.get_height() > > > textid = glGenTextures(1) > > > glBindTexture(GL_TEXTURE_2D, textid) > > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, > > GL_UNSIGNED_BYTE, > > > bin) > > > ... and so on ... > > > > > > and this is the wx code i am using : > > > > > > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) > > > bin = image.ConvertToBitmap() > > > w,h = image.GetWidth(), image.GetHeight() > > > textid = glGenTextures(1) > > > glBindTexture(GL_TEXTURE_2D, textid) > > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, > > GL_UNSIGNED_BYTE, > > > bin) > > > ... etc ... > > > > > > It doesnt crash but the texture that OpenGL displays in not > > at all the > > > image i am importing but some weird random colors. I guess > > this is the > > > bit that i am missing, since printing > > "image.ConvertToBitmap()" returns > > > a wxBitmap instance and not the image data > > > bin = pygame.image.tostring(surface, "RGBA", 1) > > > > > > I have been trying to find out how to access the data an > > looking for > > > examples on the net but did not find anything. > > > > > > any tips? thanks! > > > > > > enrike > > > > > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the > > chance to > > > share your > > > opinions on IT & business topics through brief surveys-and > > earn cash > > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > > > > > < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > >> > > > _______________________________________________ > > > PyOpenGL Homepage > > > http://pyopengl.sourceforge.net < > http://pyopengl.sourceforge.net> > > > _______________________________________________ > > > PyOpenGL-Users mailing list > > > PyO...@li... > > <mailto:PyO...@li...> > > > <mailto: PyO...@li... > > <mailto:PyO...@li...>> > > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to > > share your > > opinions on IT & business topics through brief surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > > _______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > > <mailto:PyO...@li...> > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: altern <al...@gm...> - 2007-03-29 17:50:54
|
you are right i just discovered that. I can see as well that there is a way to get the alpha info image.GetAlpha() but i am not sure how to use this two different types of data to construct a valid opengl texture with alpha. Matthew Morris(e)k dio: > Doesn't image.GetData() return RGB, and not RGBA, data? > > On 3/29/07, *altern* <al...@gm... <mailto:al...@gm...>> wrote: > > thanks andrew, i dont know how i did not find this myself, i was > looking in > wxBitmap class for this type of function. > still i dont get the images properly displayed. I can see it has similar > colors as the original but it is heavily pixelated. Is there any > difference in the format of the image data array itself between wx and > pygame? > > Andrew Wilson(e)k dio: > > Hello, > > You may want to try, > > > > bin = image.GetData() > > > > > > Thanks > > andrew > > > > > > > > On 3/29/07, *altern* < al...@gm... > <mailto:al...@gm...> <mailto:al...@gm... > <mailto:al...@gm...>>> wrote: > > > > hi > > > > I am trying to translate a pygame+opengl application to > wx+opengl. > > And I > > am stuck at the function to import images to create OpenGL > textures. > > > > I already asked for help on the wxpython list, but nobody > seemed to be > > interested on my problem, so i thought there might be some > wx-pyopengl > > users in the pyopengl list. > > > > This is the pygame code: > > > > surface = pygame.image.load(path) > > if surface.get_alpha is None: > > surface = surface.convert () > > else: > > surface = surface.convert_alpha () > > bin = pygame.image.tostring(surface, "RGBA", 1) > > w, h = surface.get_width(), surface.get_height() > > textid = glGenTextures(1) > > glBindTexture(GL_TEXTURE_2D, textid) > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, > GL_UNSIGNED_BYTE, > > bin) > > ... and so on ... > > > > and this is the wx code i am using : > > > > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) > > bin = image.ConvertToBitmap() > > w,h = image.GetWidth(), image.GetHeight() > > textid = glGenTextures(1) > > glBindTexture(GL_TEXTURE_2D, textid) > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, > GL_UNSIGNED_BYTE, > > bin) > > ... etc ... > > > > It doesnt crash but the texture that OpenGL displays in not > at all the > > image i am importing but some weird random colors. I guess > this is the > > bit that i am missing, since printing > "image.ConvertToBitmap()" returns > > a wxBitmap instance and not the image data > > bin = pygame.image.tostring(surface, "RGBA", 1) > > > > I have been trying to find out how to access the data an > looking for > > examples on the net but did not find anything. > > > > any tips? thanks! > > > > enrike > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the > chance to > > share your > > opinions on IT & business topics through brief surveys-and > earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > > > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>> > > _______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net <http://pyopengl.sourceforge.net> > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > <mailto:PyO...@li...> > > <mailto: PyO...@li... > <mailto:PyO...@li...>> > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users |
From: altern <al...@gm...> - 2007-03-29 17:41:06
|
ok, now i see that it is RGB and not RGBA format, so by doing GL_RGB instead of GL_RGBA i get the texture ok but with no alpha channel. gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGB, GL_UNSIGNED_BYTE, bin) altern(e)k dio: > thanks andrew, i dont know how i did not find this myself, i was looking in > wxBitmap class for this type of function. > still i dont get the images properly displayed. I can see it has similar > colors as the original but it is heavily pixelated. Is there any > difference in the format of the image data array itself between wx and > pygame? > > Andrew Wilson(e)k dio: >> Hello, >> You may want to try, >> >> bin = image.GetData() >> >> >> Thanks >> andrew >> >> >> >> On 3/29/07, *altern* < al...@gm... <mailto:al...@gm...>> >> wrote: >> >> hi >> >> I am trying to translate a pygame+opengl application to wx+opengl. >> And I >> am stuck at the function to import images to create OpenGL textures. >> >> I already asked for help on the wxpython list, but nobody seemed >> to be >> interested on my problem, so i thought there might be some >> wx-pyopengl >> users in the pyopengl list. >> >> This is the pygame code: >> >> surface = pygame.image.load(path) >> if surface.get_alpha is None: >> surface = surface.convert() >> else: >> surface = surface.convert_alpha () >> bin = pygame.image.tostring(surface, "RGBA", 1) >> w, h = surface.get_width(), surface.get_height() >> textid = glGenTextures(1) >> glBindTexture(GL_TEXTURE_2D, textid) >> gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, >> bin) >> ... and so on ... >> >> and this is the wx code i am using : >> >> image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) >> bin = image.ConvertToBitmap() >> w,h = image.GetWidth(), image.GetHeight() >> textid = glGenTextures(1) >> glBindTexture(GL_TEXTURE_2D, textid) >> gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, >> bin) >> ... etc ... >> >> It doesnt crash but the texture that OpenGL displays in not at all >> the >> image i am importing but some weird random colors. I guess this is >> the >> bit that i am missing, since printing "image.ConvertToBitmap()" >> returns >> a wxBitmap instance and not the image data >> bin = pygame.image.tostring(surface, "RGBA", 1) >> >> I have been trying to find out how to access the data an looking for >> examples on the net but did not find anything. >> >> any tips? thanks! >> >> enrike >> >> >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys-and earn cash >> >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> >> <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> >> >> _______________________________________________ >> PyOpenGL Homepage >> http://pyopengl.sourceforge.net <http://pyopengl.sourceforge.net> >> _______________________________________________ >> PyOpenGL-Users mailing list >> PyO...@li... >> <mailto:PyO...@li...> >> https://lists.sourceforge.net/lists/listinfo/pyopengl-users >> >> > > > |
From: Matthew M. <mj...@ms...> - 2007-03-29 17:35:40
|
Doesn't image.GetData() return RGB, and not RGBA, data? On 3/29/07, altern <al...@gm...> wrote: > > thanks andrew, i dont know how i did not find this myself, i was looking > in > wxBitmap class for this type of function. > still i dont get the images properly displayed. I can see it has similar > colors as the original but it is heavily pixelated. Is there any > difference in the format of the image data array itself between wx and > pygame? > > Andrew Wilson(e)k dio: > > Hello, > > You may want to try, > > > > bin = image.GetData() > > > > > > Thanks > > andrew > > > > > > > > On 3/29/07, *altern* < al...@gm... <mailto:al...@gm...>> > wrote: > > > > hi > > > > I am trying to translate a pygame+opengl application to wx+opengl. > > And I > > am stuck at the function to import images to create OpenGL textures. > > > > I already asked for help on the wxpython list, but nobody seemed to > be > > interested on my problem, so i thought there might be some > wx-pyopengl > > users in the pyopengl list. > > > > This is the pygame code: > > > > surface = pygame.image.load(path) > > if surface.get_alpha is None: > > surface = surface.convert() > > else: > > surface = surface.convert_alpha () > > bin = pygame.image.tostring(surface, "RGBA", 1) > > w, h = surface.get_width(), surface.get_height() > > textid = glGenTextures(1) > > glBindTexture(GL_TEXTURE_2D, textid) > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, > > bin) > > ... and so on ... > > > > and this is the wx code i am using : > > > > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) > > bin = image.ConvertToBitmap() > > w,h = image.GetWidth(), image.GetHeight() > > textid = glGenTextures(1) > > glBindTexture(GL_TEXTURE_2D, textid) > > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, > > bin) > > ... etc ... > > > > It doesnt crash but the texture that OpenGL displays in not at all > the > > image i am importing but some weird random colors. I guess this is > the > > bit that i am missing, since printing "image.ConvertToBitmap()" > returns > > a wxBitmap instance and not the image data > > bin = pygame.image.tostring(surface, "RGBA", 1) > > > > I have been trying to find out how to access the data an looking for > > examples on the net but did not find anything. > > > > any tips? thanks! > > > > enrike > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to > > share your > > opinions on IT & business topics through brief surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > < > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > > _______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net <http://pyopengl.sourceforge.net> > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > > <mailto:PyO...@li...> > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: altern <al...@gm...> - 2007-03-29 17:27:16
|
thanks andrew, i dont know how i did not find this myself, i was looking in wxBitmap class for this type of function. still i dont get the images properly displayed. I can see it has similar colors as the original but it is heavily pixelated. Is there any difference in the format of the image data array itself between wx and pygame? Andrew Wilson(e)k dio: > Hello, > You may want to try, > > bin = image.GetData() > > > Thanks > andrew > > > > On 3/29/07, *altern* < al...@gm... <mailto:al...@gm...>> wrote: > > hi > > I am trying to translate a pygame+opengl application to wx+opengl. > And I > am stuck at the function to import images to create OpenGL textures. > > I already asked for help on the wxpython list, but nobody seemed to be > interested on my problem, so i thought there might be some wx-pyopengl > users in the pyopengl list. > > This is the pygame code: > > surface = pygame.image.load(path) > if surface.get_alpha is None: > surface = surface.convert() > else: > surface = surface.convert_alpha () > bin = pygame.image.tostring(surface, "RGBA", 1) > w, h = surface.get_width(), surface.get_height() > textid = glGenTextures(1) > glBindTexture(GL_TEXTURE_2D, textid) > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, > bin) > ... and so on ... > > and this is the wx code i am using : > > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) > bin = image.ConvertToBitmap() > w,h = image.GetWidth(), image.GetHeight() > textid = glGenTextures(1) > glBindTexture(GL_TEXTURE_2D, textid) > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, > bin) > ... etc ... > > It doesnt crash but the texture that OpenGL displays in not at all the > image i am importing but some weird random colors. I guess this is the > bit that i am missing, since printing "image.ConvertToBitmap()" returns > a wxBitmap instance and not the image data > bin = pygame.image.tostring(surface, "RGBA", 1) > > I have been trying to find out how to access the data an looking for > examples on the net but did not find anything. > > any tips? thanks! > > enrike > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV> > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net <http://pyopengl.sourceforge.net> > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > |
From: Andrew W. <and...@al...> - 2007-03-29 13:30:39
|
Hello, You may want to try, bin = image.GetData() Thanks andrew On 3/29/07, altern <al...@gm...> wrote: > > hi > > I am trying to translate a pygame+opengl application to wx+opengl. And I > am stuck at the function to import images to create OpenGL textures. > > I already asked for help on the wxpython list, but nobody seemed to be > interested on my problem, so i thought there might be some wx-pyopengl > users in the pyopengl list. > > This is the pygame code: > > surface = pygame.image.load(path) > if surface.get_alpha is None: > surface = surface.convert() > else: > surface = surface.convert_alpha() > bin = pygame.image.tostring(surface, "RGBA", 1) > w, h = surface.get_width(), surface.get_height() > textid = glGenTextures(1) > glBindTexture(GL_TEXTURE_2D, textid) > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bin) > ... and so on ... > > and this is the wx code i am using : > > image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) > bin = image.ConvertToBitmap() > w,h = image.GetWidth(), image.GetHeight() > textid = glGenTextures(1) > glBindTexture(GL_TEXTURE_2D, textid) > gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bin) > ... etc ... > > It doesnt crash but the texture that OpenGL displays in not at all the > image i am importing but some weird random colors. I guess this is the > bit that i am missing, since printing "image.ConvertToBitmap()" returns > a wxBitmap instance and not the image data > bin = pygame.image.tostring(surface, "RGBA", 1) > > I have been trying to find out how to access the data an looking for > examples on the net but did not find anything. > > any tips? thanks! > > enrike > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: altern <al...@gm...> - 2007-03-29 08:25:42
|
hi I am trying to translate a pygame+opengl application to wx+opengl. And I am stuck at the function to import images to create OpenGL textures. I already asked for help on the wxpython list, but nobody seemed to be interested on my problem, so i thought there might be some wx-pyopengl users in the pyopengl list. This is the pygame code: surface = pygame.image.load(path) if surface.get_alpha is None: surface = surface.convert() else: surface = surface.convert_alpha() bin = pygame.image.tostring(surface, "RGBA", 1) w, h = surface.get_width(), surface.get_height() textid = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, textid) gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bin) ... and so on ... and this is the wx code i am using : image = wx.Image(path, wx.BITMAP_TYPE_ANY, -1) bin = image.ConvertToBitmap() w,h = image.GetWidth(), image.GetHeight() textid = glGenTextures(1) glBindTexture(GL_TEXTURE_2D, textid) gluBuild2DMipmaps(GL_TEXTURE_2D, 4, w, h, GL_RGBA, GL_UNSIGNED_BYTE, bin) ... etc ... It doesnt crash but the texture that OpenGL displays in not at all the image i am importing but some weird random colors. I guess this is the bit that i am missing, since printing "image.ConvertToBitmap()" returns a wxBitmap instance and not the image data bin = pygame.image.tostring(surface, "RGBA", 1) I have been trying to find out how to access the data an looking for examples on the net but did not find anything. any tips? thanks! enrike |
From: Alexander T. <ale...@ca...> - 2007-03-28 15:31:54
|
Hi There, I've been using PyOpenGL with WXpython under linux and it's been working fine. Now, I have a problem in that I have a lot of file reading to do an then to render it as quickly as possible. I've got the routines in C++ to do it but I don't know how to hook up to the opengl instances used by PyOpenGL. I've been using SWIG to wrap my C++ extensions for python. Anybody got an example code showing how to do this? Many thanks, Alex -- ---------------------------- Alexander L. Tournier, PhD Cancer Research UK 44 Lincoln's Inn Fields LONDON Tel: 0207 269 3583 Fax: 0207 269 3258 |
From: Tom D. <td...@yo...> - 2007-03-28 00:59:35
|
Alexander Gabriel wrote: > Hi list! > > I've got a little problem with following code. (extra for you stripped > down to the minimum) > > <snip> > > #!/usr/bin/env python > from OpenGL.GL import * > import threading > from time import sleep > from wx import wx > from wx import glcanvas > > > class foo(threading.Thread): > def __init__(self): > threading.Thread.__init__(self) > self.canvas = glcanvas.GLCanvas(frame, pos =(0,0), size= (100,100)) > self.canvas.SetCurrent() > > > def run(self): > while True: > glFlush() # dies here > sleep(1) > > > > app = wx.PySimpleApp() > frame = wx.Frame(None, -1, "blafasel",(100,100)) > t = foo() > frame.Show(True) > t.start() #dies > # glFlush() #lives > app.MainLoop() > > > > > </snip> > > which gives following error message > > > <snip> > > imtrey% ./test2.py > zsh: segmentation fault (core dumped) ./test2.py > imtrey% > > </snip> > > > Which does not happen, if I don't start the foo thread but call glFlush > alone. > > Can someone please point me to my mistake? I suspect only the main gui thread should access widgets objects. regards- |
From: Alexander G. <Ale...@tu...> - 2007-03-27 22:19:38
|
Hi list! I've got a little problem with following code. (extra for you stripped down to the minimum) <snip> #!/usr/bin/env python from OpenGL.GL import * import threading from time import sleep from wx import wx from wx import glcanvas class foo(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.canvas = glcanvas.GLCanvas(frame, pos =(0,0), size= (100,100)) self.canvas.SetCurrent() def run(self): while True: glFlush() # dies here sleep(1) app = wx.PySimpleApp() frame = wx.Frame(None, -1, "blafasel",(100,100)) t = foo() frame.Show(True) t.start() #dies # glFlush() #lives app.MainLoop() </snip> which gives following error message <snip> imtrey% ./test2.py zsh: segmentation fault (core dumped) ./test2.py imtrey% </snip> Which does not happen, if I don't start the foo thread but call glFlush alone. Can someone please point me to my mistake? Best wishes, alex |
From: Greg E. <gre...@ca...> - 2007-03-18 00:07:07
|
horace wrote: > so if i understand this correctly, pyopengl consist of an auto-generated > "raw" opengl layer and another layer on top of it which makes it more > "pythonic"? and the auto-generated ctypes "raw" layer could in theory be > replaced with an auto-generated pyrex "raw" layer? If the ctypes layer is already being auto-generated, there shouldn't be any technical obstacle to generating Pyrex definitions instead, I would think. -- Greg |
From: horace <hor...@gm...> - 2007-03-17 07:37:04
|
so if i understand this correctly, pyopengl consist of an auto-generated "raw" opengl layer and another layer on top of it which makes it more "pythonic"? and the auto-generated ctypes "raw" layer could in theory be replaced with an auto-generated pyrex "raw" layer? and this could make pyopengl a bit faster? :) sounds interesting... i also find the pypy project very fascinating. i am looking forward to see the first parts of it getting production ready and also to see how fast they can get python with their jit work. On 3/16/07, Mike C. Fletcher <mcf...@vr...> wrote: > > horace wrote: > > would it be possible to write a tool which automatically converts > > ctype wrappers to pyrex? wouldn't that be nice? > > > > i am no computer scientist though and maybe this is a stupid idea > > which isn't feasible. :) > In fact, PyPy is able to translate a subset of ctypes into a number of > code types including C code with type inferencing allowing for > significant code simplification... i.e. the code should get close to the > speed of directly C-coded source code. > > The wrappers are also built from gcc-xml output (for the "raw" API), I > *believe* pyrex already has a mechanism that allows for the same > transformation (i.e. build a raw API from raw gcc-xml). Which is to > say, we could, in theory, provide a way to register a "raw" API plugin > for PyOpenGL that would allow for entirely replacing the core-code > operations (or something like that). That way a compiled system could > provide a run-time pluggable replacement for the pure-python code... in > theory, anyway... > > Have to get back to work now. > > Have fun, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: Mike C. F. <mcf...@vr...> - 2007-03-16 20:47:03
|
horace wrote: > would it be possible to write a tool which automatically converts > ctype wrappers to pyrex? wouldn't that be nice? > > i am no computer scientist though and maybe this is a stupid idea > which isn't feasible. :) In fact, PyPy is able to translate a subset of ctypes into a number of code types including C code with type inferencing allowing for significant code simplification... i.e. the code should get close to the speed of directly C-coded source code. The wrappers are also built from gcc-xml output (for the "raw" API), I *believe* pyrex already has a mechanism that allows for the same transformation (i.e. build a raw API from raw gcc-xml). Which is to say, we could, in theory, provide a way to register a "raw" API plugin for PyOpenGL that would allow for entirely replacing the core-code operations (or something like that). That way a compiled system could provide a run-time pluggable replacement for the pure-python code... in theory, anyway... Have to get back to work now. Have fun, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: horace <hor...@gm...> - 2007-03-16 04:40:54
|
would it be possible to write a tool which automatically converts ctype wrappers to pyrex? wouldn't that be nice? i am no computer scientist though and maybe this is a stupid idea which isn't feasible. :) On 3/15/07, Thomas Heller <th...@ct...> wrote: > > Greg Ewing schrieb: > > Mike C. Fletcher wrote: > >> Actually, ctypes is quite slow compared to e.g. SWIG. That's because > it > >> does a lot more work at run-time for every call than a SWIG or similar > >> system does. OpenGL-ctypes (PyOpenGL) is even slower because it has to > >> provide the array and similar semantics that aren't available in > ctypes' > >> core. > > > > This is a little worrying, as OpenGL calls are something you > > really don't want being inefficient. I'm hoping this is more > > of a theoretical than practical concern. Has anyone done any > > measurements? > > Andrew Dalke as written two nice articles about ctypes that I know of: > > http://www.dalkescientific.com/writings/NBN/ctypes.html > http://www.dalkescientific.com/writings/NBN/c_extensions.html > > The latter has some comparisons between ctypes and a C-coded > extension. > > Thomas > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: Thomas H. <th...@ct...> - 2007-03-15 09:21:51
|
Greg Ewing schrieb: > Mike C. Fletcher wrote: >> Actually, ctypes is quite slow compared to e.g. SWIG. That's because it >> does a lot more work at run-time for every call than a SWIG or similar >> system does. OpenGL-ctypes (PyOpenGL) is even slower because it has to >> provide the array and similar semantics that aren't available in ctypes' >> core. > > This is a little worrying, as OpenGL calls are something you > really don't want being inefficient. I'm hoping this is more > of a theoretical than practical concern. Has anyone done any > measurements? Andrew Dalke as written two nice articles about ctypes that I know of: http://www.dalkescientific.com/writings/NBN/ctypes.html http://www.dalkescientific.com/writings/NBN/c_extensions.html The latter has some comparisons between ctypes and a C-coded extension. Thomas |
From: JoN <jo...@we...> - 2007-03-14 01:45:40
|
Much thanks Mike and Shane, I'll look into these. Cheers Jon Quoting Shane Holloway <sha...@ie...>: > ipython is certainly doing this. I saw the demo at PyCon, and have > been using it to great effect in debugging and interacting with my wx > app. > > > ipython -wthread > > Works for wxPython guis. --help gives more options and a bit more > insight into it. I'd have a look at what they did to see if it will > work for you as is, or for your own cmd-based interactive app. > > -Shane > > On Mar 12, 2007, at 10:37 PM, Mike C. Fletcher wrote: > > > JoN wrote: > >> And then he realizes he's asked the completely wrong question. > >> > >> What I meant to ask was: > >> > >> Can IDLE - or any python command interpreter for that matter? - be > >> run itself as > >> a pythread ? > >> > > There have been systems that used Idle connected up to a GUI with > > PyOpenGL running in it. I seem to recall systems with IPython and > > a Tk > > OpenGL GUI as well. I haven't done it myself, nor do I know if they > > actually used threads. Normally what happens is that you need to > > arrange to have two event loops running. Some GUIs (wxPython, for > > instance) can handle that using threads as long as you make sure that > > your first import of wxPython is in the secondary thread (IIRC). > > Running an interpreter thread using cmd should allow you to run > > that in > > a background thread and let the GUI use the main thread AFAICS. > > > > I code my own systems using something like the wxPython shell widget > > hooked up to a wxPython GUI, so the system all runs in the same > > thread, > > but that has its own challenges when you want a user to code (e.g. > > they > > want to time.sleep() in a script). > > > > HTH, > > Mike > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > -------------------------------------------------------------------- Come and visit Web Prophets Website at http://www.webprophets.net.au |