pyopengl-users Mailing List for PyOpenGL (Page 59)
Brought to you by:
mcfletch
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(81) |
Oct
(41) |
Nov
(55) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(34) |
Feb
(3) |
Mar
(16) |
Apr
(5) |
May
(10) |
Jun
(13) |
Jul
(24) |
Aug
(14) |
Sep
(14) |
Oct
(9) |
Nov
(10) |
Dec
(16) |
2003 |
Jan
(25) |
Feb
(59) |
Mar
(9) |
Apr
(21) |
May
(54) |
Jun
(4) |
Jul
(16) |
Aug
(19) |
Sep
(19) |
Oct
(15) |
Nov
(13) |
Dec
(22) |
2004 |
Jan
(19) |
Feb
(8) |
Mar
(20) |
Apr
(16) |
May
(13) |
Jun
(18) |
Jul
(18) |
Aug
(14) |
Sep
(24) |
Oct
(47) |
Nov
(20) |
Dec
(10) |
2005 |
Jan
(23) |
Feb
(31) |
Mar
(11) |
Apr
(29) |
May
(18) |
Jun
(7) |
Jul
(11) |
Aug
(12) |
Sep
(8) |
Oct
(4) |
Nov
(11) |
Dec
(7) |
2006 |
Jan
(7) |
Feb
(8) |
Mar
(15) |
Apr
(3) |
May
(8) |
Jun
(25) |
Jul
(19) |
Aug
(3) |
Sep
(17) |
Oct
(27) |
Nov
(24) |
Dec
(9) |
2007 |
Jan
(6) |
Feb
(43) |
Mar
(33) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(8) |
Sep
(11) |
Oct
(22) |
Nov
(15) |
Dec
(18) |
2008 |
Jan
(14) |
Feb
(6) |
Mar
(6) |
Apr
(37) |
May
(13) |
Jun
(17) |
Jul
(22) |
Aug
(16) |
Sep
(14) |
Oct
(16) |
Nov
(29) |
Dec
(13) |
2009 |
Jan
(7) |
Feb
(25) |
Mar
(38) |
Apr
(57) |
May
(12) |
Jun
(32) |
Jul
(32) |
Aug
(35) |
Sep
(10) |
Oct
(28) |
Nov
(16) |
Dec
(49) |
2010 |
Jan
(57) |
Feb
(37) |
Mar
(22) |
Apr
(15) |
May
(45) |
Jun
(25) |
Jul
(32) |
Aug
(7) |
Sep
(13) |
Oct
(2) |
Nov
(11) |
Dec
(28) |
2011 |
Jan
(35) |
Feb
(39) |
Mar
|
Apr
(25) |
May
(32) |
Jun
(17) |
Jul
(29) |
Aug
(10) |
Sep
(26) |
Oct
(9) |
Nov
(28) |
Dec
(4) |
2012 |
Jan
(24) |
Feb
(47) |
Mar
(4) |
Apr
(8) |
May
(9) |
Jun
(6) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(28) |
Nov
(2) |
Dec
(2) |
2013 |
Jan
(11) |
Feb
(3) |
Mar
(4) |
Apr
(38) |
May
(15) |
Jun
(11) |
Jul
(15) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(3) |
Dec
(14) |
2014 |
Jan
(24) |
Feb
(31) |
Mar
(28) |
Apr
(16) |
May
(7) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(10) |
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
(6) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(19) |
Dec
|
2016 |
Jan
(6) |
Feb
(1) |
Mar
(7) |
Apr
|
May
(6) |
Jun
|
Jul
(3) |
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2018 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mike C. F. <mcf...@vr...> - 2008-09-15 02:19:39
|
I've just uploaded PyOpenGL 3.0.0b6 to SourceForge and PyPI. At this point there's not really much I'm intending to change before the 3.0.0 final release. We now have support for extensions up to the OpenGL 3.0 release, we should run on Win32 and Linux at least. We should be compatible with py2exe/pyinstaller/py2app. From here on out what we need is testing on various platforms, with various software configurations. I wouldn't be surprised if we find some bugs if there's no Numpy installed, or that we'll get unhappy results if you don't have GLUT or GLE and try to use them. I'd also suspect that our GLX/WGL/AGL wrapper is pretty unusable at this point (my not having any code that really tries to use it). There are likely dozens of extensions that are also in need of tweaked wrappers. In theory I might look at doing some optimizations or some more cleanup, but it's been years since we had a final release[1], and that can likely wait for a 3.0.1 release. With that said: easy_install PyOpenGL to setup PyOpenGL afresh, or easy_install -U PyOpenGL to update. If show-stopping bugs show up, we may need another beta, but at this point I don't know of any show-stoppers to get in the way. BTW, the online documentation[2] has been updated to cover the OpenGL 2.1 version of OpenGL, with links to a wider range of PyOpenGL-using Open Source projects. If you'd like your project added to the set of sample-code projects and you have an online source-code-control viewing system, just let me know. Enjoy yourselves, Mike [1] April 30. 2005 is the day I started work in earnest on replacing the SWIG-based PyOpenGL with a ctypes implementation... I can't claim to have been working solidly that whole time, however. [2] http://pyopengl.sourceforge.net/documentation/manual-3.0/index.xhtml -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-09-12 03:54:24
|
Mike C. Fletcher wrote: > Dirk Reiners wrote: > >> Hi Mike, >> >> any news on the Windows shader problem? has anybody else been able to reproduce it? >> >> > Not yet. I've been able to use extensions on my XP laptop, but it > doesn't have shader support. My Win2K machine (which has a reasonable > video card) spent the entire time I was intending to work on it just > getting updated and cleaned up so it would run properly. > > Take care, > Mike > I found the bug. Basically there was a wrapper for glShaderSource/glShaderSourceARB which was not passing in the "extension" parameter which was being used to decide whether the function should be available. Previously we would just try to get the function and check for a NULL pointer, but the Mesa implementation decided to start returning non-null pointers that just print out warning messages when you try to call a non-existent function, so we started checking for the extensions. Unfortunately, the wrapper didn't get updated, so the test was always coming up false. Anyway, with current CVS shaders should work on Win32. I'll likely be doing some further refactoring of the base platform module to clean it up and see if I can discover the problem on OSX tomorrow. Take care, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-09-11 23:15:26
|
Amit Mohanty wrote: > i am trying to use this following file with a pdf file for my presentation. > > http://www.cs.rit.edu/~jrm8005/accentuate/accentuate > > I have downloaded and installed the required the models. But I keep > getting this error msg. > > C:\Python25\Lib\site-packages>python accentuate presentation2.pdf > Welcome to Accentuate version 1.0 > LIRC support unavailable. > Oops! Cannot load necessary modules: No module named OpenGL.GL > If you can run: python -c "from OpenGL import GL" at the command line it would likely provide a more helpful error message (a traceback). The most likely cause is that you're using PyOpenGL 3.x without running the setup.py script to install the package. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Amit M. <amo...@pu...> - 2008-09-11 22:29:54
|
i am trying to use this following file with a pdf file for my presentation. http://www.cs.rit.edu/~jrm8005/accentuate/accentuate I have downloaded and installed the required the models. But I keep getting this error msg. C:\Python25\Lib\site-packages>python accentuate presentation2.pdf Welcome to Accentuate version 1.0 LIRC support unavailable. Oops! Cannot load necessary modules: No module named OpenGL.GL To use Accentuate, you need to install the following Python modules: - PyOpenGL [python-opengl] http://pyopengl.sourceforge.net/ - PyGame [python-pygame] http://www.pygame.org/ - PIL [python-imaging] http://www.pythonware.com/products/pil/ - PyWin32 (OPTIONAL, Win32) http://starship.python.net/crew/mhammond/win32/ Additionally, please be sure to have pdftoppm or GhostScript installed if you intend to use PDF input. I am concerned about the fact that it cant find the module. I mean, I did the same in my lab, but it worked. Ars |
From: Mike C. F. <mcf...@vr...> - 2008-09-11 12:30:24
|
Dirk Reiners wrote: > Hi Mike, > > any news on the Windows shader problem? has anybody else been able to reproduce it? > Not yet. I've been able to use extensions on my XP laptop, but it doesn't have shader support. My Win2K machine (which has a reasonable video card) spent the entire time I was intending to work on it just getting updated and cleaned up so it would run properly. Take care, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-09-11 12:28:31
|
Steven White wrote: > I am testing a PyOpenGL install on OS X vr 10.4 and have run in to some > trouble with the OpenGL shader implementation in an example written for > 3.X. The Error is included below along with some information about the > system it is currently running on. > It's a bug in the baseplatform module. It's incorrectly assuming that we always use indirect pointers for extension functions (OSX uses regular functions). The fix should be straightforward, but it looks like the code needs some clean-up to reduce the amount of code duplication in the module. I'll try to get to that tomorrow. Take care, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Steven W. <st...@li...> - 2008-09-10 20:00:34
|
I am testing a PyOpenGL install on OS X vr 10.4 and have run in to some trouble with the OpenGL shader implementation in an example written for 3.X. The Error is included below along with some information about the system it is currently running on. python shader_test.py is available at http://storage.sureal.cc/python/shader_test. As a side note I am able to run http://storage.sureal.cc/python/Works.zip. Maybe a more experienced user can help identify the major differences between the two programs. Hit ESC key to quit. Traceback (most recent call last): File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python25/work/Python-2.5.2/Modules/_ctypes/callbacks.c", line 206, in 'calling callback function' File "shader_test.py", line 121, in DrawGLScene InitGL(640, 480) File "shader_test.py", line 98, in InitGL ''', File "shader_test.py", line 27, in compileProgram program = glCreateProgramObjectARB() File "/opt/local/lib/python2.5/site-packages/OpenGL/platform/baseplatform.py", line 296, in __call__ if self.extension and self.load(): File "/opt/local/lib/python2.5/site-packages/OpenGL/platform/baseplatform.py", line 275, in load pointer = platform.PLATFORM.getExtensionProcedure( AttributeError: 'DarwinPlatform' object has no attribute 'getExtensionProcedure' I am currently using the MacPorts project for my python installs. XCode 2.5 is installed on the system. I used the py25-openGL build which is PyOpenGL version 3.0.0b5. Yesterday I manually installed Python 2.5 and PyOpenGL 3.0b5 and ran in to the exact same error. I wanted to make sure that I did not cause the problem with an abundance of possible lib conflicts from the install being old. So this morning I reinstalled OS X and cleaned off the HDD. The install is up to date now with only XCode 2.5, MacPorts, and PyOpenGL installed. MacPorts installs all of its files in /opt/local. The environment when the error was received was. declare -x HOME="/Users/steven" declare -x INCLUDE_PATH="/opt/local/include:" declare -x LANG="en_US.US-ASCII" declare -x LC_COLLATE="en_US.US-ASCII" declare -x LC_CTYPE="en_US.US-ASCII" declare -x LC_MESSAGES="en_US.US-ASCII" declare -x LC_MONETARY="en_US.US-ASCII" declare -x LC_NUMERIC="en_US.US-ASCII" declare -x LC_TIME="en_US.US-ASCII" declare -x LD_LIBRARY_PATH="/opt/local/lib:" declare -x LOGNAME="steven" declare -x OLDPWD declare -x PATH="/opt/local/sbin:/opt/local/bin:/bin:/sbin:/usr/bin:/usr/sbin" declare -x PWD="/Users/steven" declare -x SECURITYSESSIONID="990af0" declare -x SHELL="/bin/bash" declare -x SHLVL="1" declare -x TERM="linux" declare -x TERM_PROGRAM="iTerm.app" declare -x USER="steven" declare -x __CF_USER_TEXT_ENCODING="0x1F5:0:0" |
From: Dirk R. <di...@li...> - 2008-09-05 21:37:41
|
Hi Mike, any news on the Windows shader problem? has anybody else been able to reproduce it? Mike C. Fletcher wrote: > Me either. I tested easy_installing on a Win32 box a long while ago, > but apparently something has broken in the meantime. :( > Didn't realize we had those... I'll have to track them down and make > sure they're accurate still... I was talking about "Accessing OpenGL Functionality" on http://pyopengl.sourceforge.net/ctypes/using.html, which gave me enough hints to get it done. A more complete documentation would be good, but that's what I used. > It runs without alteration on an AMD64 Gentoo Linux box with Nvidia and > latest CVS of PyOpenGL. I'll have to fire up the Win32 box and see if I > can track down the problem over there. I'll keep you apprised. Thanks Dirk |
From: Mike C. F. <mcf...@vr...> - 2008-08-29 12:51:21
|
Dirk Reiners wrote: > I'm trying to set it to be easy for a Windows user, and I didn't use > easy_install, I just ran setup.py from the OpenGL Context. Let me try > that one. Obviously I'm going to have to fire up a Win32 box and see what's wrong over there. > Not sure what's wrong here. Me either. I tested easy_installing on a Win32 box a long while ago, but apparently something has broken in the meantime. > OK, RTFM really does help. :-/ I found the extension usage docs. Didn't realize we had those... I'll have to track them down and make sure they're accurate still... > So I changed your shaderobjects example to run with raw GLUT. But it's > not working. I do get past the glInitShaderObjectsARB etc., but when I > try to call glShaderSourceARB it says it's not available. > OpenGLExtensionsViewer confirms that the extension really is > supported, so I'm a little confused. > > I attached the program, if somebody could try this on their system I'd > appreciate it. It runs without alteration on an AMD64 Gentoo Linux box with Nvidia and latest CVS of PyOpenGL. I'll have to fire up the Win32 box and see if I can track down the problem over there. I'll keep you apprised. Take care, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Dirk R. <di...@li...> - 2008-08-28 14:35:50
|
Hi Mike, thanks for the quick response! Mike C. Fletcher wrote: > > vrml97.arrays is part of PyVRML97... assuming it's installed... > > easy_install pyvrml97 > > should have happened when you did > > easy_install OpenGLContext > > However... I'm trying to set it to be easy for a Windows user, and I didn't use easy_install, I just ran setup.py from the OpenGL Context. Let me try that one. This is what I get: D:\CMPS415_Stuff\Python25\Scripts>easy_install.exe OpenGLContext Searching for OpenGLContext Best match: OpenGLContext 2.1.0a2 Adding OpenGLContext 2.1.0a2 to easy-install.pth file Installing vrml_view-script.pyw script to D:\CMPS415_Stuff\Python25\Scripts Installing vrml_view.exe script to D:\CMPS415_Stuff\Python25\Scripts Installing choosecontext-script.pyw script to D:\CMPS415_Stuff\Python25\Scripts Installing choosecontext.exe script to D:\CMPS415_Stuff\Python25\Scripts Using d:\cmps415_stuff\python25\lib\site-packages Processing dependencies for OpenGLContext Searching for PyVRML97 Reading https://sourceforge.net/project/showfiles.php?group_id=19262 Reading https://sourceforge.net/project/showfiles.php?group_id=84080 Reading http://pypi.python.org/simple/PyVRML97/ Couldn't find index page for 'PyVRML97' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ No local packages or download links found for PyVRML97 error: Could not find suitable distribution for Requirement.parse('PyVRML97') Not sure what's wrong here. > There's no need at all for OpenGLContext to use extensions. > OpenGLContext is a separate project. The reason I mentioned it is that > it has *sample* code for using shaders. Extensions are all available as > simple imports in PyOpenGL, see: > > OpenGL/tests/tests.py:552 > > for an example of using the frame buffer object extension in PyOpenGL, > for instance. Or OpenGL/arrays/vbo.py for code using vertex buffer > objects. OK, RTFM really does help. :-/ I found the extension usage docs. So I changed your shaderobjects example to run with raw GLUT. But it's not working. I do get past the glInitShaderObjectsARB etc., but when I try to call glShaderSourceARB it says it's not available. OpenGLExtensionsViewer confirms that the extension really is supported, so I'm a little confused. I attached the program, if somebody could try this on their system I'd appreciate it. Thanks Dirk |
From: Mike C. F. <mcf...@vr...> - 2008-08-28 12:35:44
|
Dirk Reiners wrote: > Hi Mike, > > Mike C. Fletcher wrote: > >> The shaderobject.py test just ran on my (Linux) workstation here, so the >> code should be reasonably close to working. >> > > I'm having trouble getting that to work. It complains about not being able to > find vrml.arrays, and I can't find it either... > vrml97.arrays is part of PyVRML97... assuming it's installed... easy_install pyvrml97 should have happened when you did easy_install OpenGLContext However... > Is there a way to get at the extension system without going through the full > OpenGL Context? Or using a GLUT context? I'm a little confused by the whole > context code... ;) > There's no need at all for OpenGLContext to use extensions. OpenGLContext is a separate project. The reason I mentioned it is that it has *sample* code for using shaders. Extensions are all available as simple imports in PyOpenGL, see: OpenGL/tests/tests.py:552 for an example of using the frame buffer object extension in PyOpenGL, for instance. Or OpenGL/arrays/vbo.py for code using vertex buffer objects. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Dirk R. <di...@li...> - 2008-08-28 03:39:31
|
Hi Mike, Mike C. Fletcher wrote: > > The shaderobject.py test just ran on my (Linux) workstation here, so the > code should be reasonably close to working. I'm having trouble getting that to work. It complains about not being able to find vrml.arrays, and I can't find it either... Is there a way to get at the extension system without going through the full OpenGL Context? Or using a GLUT context? I'm a little confused by the whole context code... ;) Thanks Dirk |
From: Mike C. F. <mcf...@vr...> - 2008-08-25 11:40:12
|
Festila Catalin wrote: > I need help with > import OpenGLContext > this is output > >>> dir(OpenGL) > ['ALLOW_NUMPY_SCALARS', 'ERROR_CHECKING', 'ERROR_LOGGING', > 'ERROR_ON_COPY', > 'FULL_LOGGING', 'GL', 'UNSIGNED_BYTE_IMAGES_AS_ > STRING', '__builtins__', > '__doc__', '__file__', '__name__', '__path__', '__version__', 'arrays', > 'constant', 'constants', 'contextdata', 'converters', 'error', > 'extensions', > 'images', 'logs', 'platform', 'raw', 'version', 'wrapper'] > >>> import OpenGLContext > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named OpenGLContext OpenGLContext is a separate project and download. Unless you *want* to use OpenGLContext, you probably don't need to install it. To install on most machines: easy_install OpenGLContext if there's something in PyOpenGL that's importing it, let me know and I'll remove it, there's not supposed to be any dependencies in that direction. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Festila C. <cat...@gm...> - 2008-08-25 10:05:06
|
I need help with import OpenGLContext this is output >>> dir(OpenGL) ['ALLOW_NUMPY_SCALARS', 'ERROR_CHECKING', 'ERROR_LOGGING', 'ERROR_ON_COPY', 'FULL_LOGGING', 'GL', 'UNSIGNED_BYTE_IMAGES_AS_STRING', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__', 'arrays', 'constant', 'constants', 'contextdata', 'converters', 'error', 'extensions', 'images', 'logs', 'platform', 'raw', 'version', 'wrapper'] >>> import OpenGLContext Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named OpenGLContext |
From: Mike C. F. <mcf...@vr...> - 2008-08-25 03:44:12
|
Nicolas Brown wrote: > Are there any examples on how to use shaders in pyopengl that actually > work, the test in pyopenglcontext doesnt work. > I get an error; > NullFunctionError: Attempt to call an undefined function > glShaderSourceARB, check for bool(glShaderSourceARB) before calling > glShaderSource doesnt work either, i get the same error.I need an > example cuz i am tired of trying to find answers and not getting any. Are you certain that your current context supports shaders? You can see by running the following from the OpenGLContext/tests directory: python glget.py | grep program There are basically two possibilities, either your context doesn't support glShaderSource, or there's something wrong with PyOpenGL's handling of extensions on your platform (possibly Windows?) I don't use Windows or OSX, so I rely on other people to report errors over there. As for a context that doesn't support the extensions, you'll see that if e.g. you have older hardware, or your drivers are very old (e.g. a stock install of Win2K) or for some reason your machine is running in software-mode rendering. The shaderobject.py test just ran on my (Linux) workstation here, so the code should be reasonably close to working. Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Nicolas B. <ncl...@ya...> - 2008-08-25 03:01:39
|
Are there any examples on how to use shaders in pyopengl that actually work, the test in pyopenglcontext doesnt work. I get an error; NullFunctionError: Attempt to call an undefined function glShaderSourceARB, check for bool(glShaderSourceARB) before calling glShaderSource doesnt work either, i get the same error.I need an example cuz i am tired of trying to find answers and not getting any. |
From: Mike C. F. <mcf...@vr...> - 2008-08-22 18:31:18
|
For those who are interested in helping with the documentation/release effort for PyOpenGL 3.x, the newly generated reference documentation is now up, and includes sample-code references for various PyOpenGL-using Open Source projects. This is still based on OpenGL 1.x documentation, despite the fact that PyOpenGL should support anything up to OpenGL 3.x. At some point hopefully someone at Khronos group will release at least the 2.1 DocBook source files and we can regenerate with those. Check it out here: http://pyopengl.sourceforge.net/documentation/manual-3.0/index.xhtml The generation process is now entirely automatic, hopefully we'll get more PyOpenGL-using projects added so that we can update the set ofsample-code projects. As mentioned earlier, there's currently no documentation for extensions. If you want to work on any of those, let me know, the code to generate the documentation is up on LaunchPad: bzr branch lp:~mcfletch/pyopengl/directdocs There's obviously lots to be done with formatting as well if someone has the time. If someone wants to add deprecation warnings for OpenGL 3.x, that would be useful too, (e.g. create a text file with the names of the deprecated functions and annotate the docs with a warning for each deprecated operation). Have fun, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-08-15 19:57:13
|
Hi everyone, It's high time we (I) got PyOpenGL 3.0.0 final released, I've been puttering with it for 2+ years now and we're getting way behind the curve. Here's what seems to be remaining in the queue for release: * documentation o regeneration of the documentation from docbook o source-code url gathering from Open Source projects o figure out an approach for extension documentation o docstring tweaks to make the run-time docs easier to understand o migration documentation + needs people with big libraries to track what they needed to do to convert to 3.x * testing o win32 and OS-X need *way* more testing o hpux, solaris and the like need to be tested to see if they're even compatible o linux other than Ubuntu and Gentoo likely needs testing o testing with missing libraries to be sure we fail with useful warnings (i.e. GLE, GLUT) o testing with big existing PyOpenGL libraries/applications o Python 2.4, and 2.6 testing * installation procedures o need more testing o need documentation o need working samples of pyinstaller, py2exe and py2app recipes + pyinstaller *should* be workable now with recipe in cvs * optimization o profile real-world code and see if we can provide a few (optional) plug-ins to speed up common code paths o likely the "wrapper" class and the associated helper functions are the most appropriate targets o possibly add a few more optimization flags to drop debug/development functionality for deployment situations * WGL/AGL/XGL o while these libraries should be there, they haven't been tested at all o no extensions to these available yet * cleanup o some hacks, such as the use of classes instead of functions for wrappers are not likely necessary any more (Python 2.2 no longer being compatible with PyOpenGL) If people have other things they feel are needed before the final 3.0.0 release, please speak up. At some point post 3.0 release I'm thinking of moving the source-code repository to LaunchPad to use BZR and allow people to hack on the code-base more easily. Enjoy yourselves, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-08-07 02:52:28
|
Ant Sibthorpe wrote: > Hi > > I've been looking at the documentation for PyOpenGL and it certainly seems > to contain pages on the ARB imaging extension that allows image histogram > generation. However, I've not been able to make this work, nor have I been > able to find out definitively whether another package, like glewpy, provides > these functions. > PyOpenGL is intended to provide the functionality. It should have been working with the latest beta, but I've just tweaked it so that it should work more reliably on systems where the functions aren't defined until there's an active context. There's a bit of sample code in the OpenGLContext/tests/glhistogram.py script I just checked into CVS, this seems to show the histogram functions in OpenGL 1.2 working as expected, though it seems to produce too large an image (4 components) for the luminance set. That sample code has only been tested against CVS PyOpenGL, however. > func = functionTypeFor( self.DLL )( > NameError: global name 'functionTypeFor' is not defined > That code doesn't exist in the current CVS, nor should it have in the latest beta. If someone has some simple stand-alone code that would let me test the functions reasonably (i.e. should produce known results and can be inserted into a test case) I'd be interested in having it. Take care, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Mike C. F. <mcf...@vr...> - 2008-08-07 00:34:02
|
Gary Herron wrote: > Prashant Saxena wrote: > >> How do we get texture back from it's ID as image declared by: >> textureId = glGenTextures(1) >> > > glGetTexImage > Example usage here: http://pyopengl.cvs.sourceforge.net/pyopengl/OpenGLContext/tests/getteximage.py?view=markup Though note that *normally* you want to keep the image locally rather than loading it into the GL and back. However, if you're doing pixel transformations or want to get e.g. mip-mapped versions of it then this approach can be useful. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Gary H. <gh...@is...> - 2008-08-06 08:37:05
|
Prashant Saxena wrote: > How do we get texture back from it's ID as image declared by: > textureId = glGenTextures(1) glGetTexImage > > This is to save the texture as image or us it any where else on an > wxWidget. > > Thanks > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > 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-08-06 06:43:51
|
How do we get texture back from it's ID as image declared by: textureId = glGenTextures(1) This is to save the texture as image or us it any where else on an wxWidget. Thanks |
From: Ant S. <an...@ce...> - 2008-08-05 09:55:57
|
Hi I've been looking at the documentation for PyOpenGL and it certainly seems to contain pages on the ARB imaging extension that allows image histogram generation. However, I've not been able to make this work, nor have I been able to find out definitively whether another package, like glewpy, provides these functions. So far, I have introduced the following into a PyOpenGL / WxPython canvas: from OpenGL.GL.ARB import imaging def OnPaint: # some code here ... glHistogram(GL_HISTOGRAM, 4, GL_RGB, GL_FALSE) glEnable(GL_HISTOGRAM) self.OnDraw() # glGetHistogram() definitely doesn't work, that's why it's commented below! #glGetHistogram(GL_HISTOGRAM, GL_FALSE, GL_RGB, GL_UNSIGNED_BYTE, self.HistValues) if glIsEnabled(GL_HISTOGRAM): print "True" else: print "False" # some more code here ... I can enable GL_HISTOGRAM, I guess because this is only setting a bool(?), but when I try to actually call the function glHistogram(), I get the following traceback: Traceback (most recent call last): File "..\glHistogramTest.py", line 97, in OnPaint glHistogram(GL_HISTOGRAM, 4, GL_RGB, GL_FALSE) File "..\Python25\lib\site-packages\OpenGL\platform\baseplatform.py", line 252, in __call__ if self.extension and self.load(): File "..\Python25\lib\site-packages\OpenGL\platform\baseplatform.py", line 234, in load func = functionTypeFor( self.DLL )( NameError: global name 'functionTypeFor' is not defined If anyone knows whether these functions are indeed supported (or not) and how, or if anyone has successfully used other modules that implement them, then I would much appreciate knowing about it. Many thanks. Ant |
From: Shari R. <sh...@lo...> - 2008-08-05 00:34:23
|
I'm using PyOpenGL to create an application that draws "billboards" with different images. The user can step though the billboards and look at the images on the different ones. The problem is that the billboards are displaying in the wrong order. The front row is in the back. In other words, if there are n rows, the order in which they are displayed is 1, 2, 3, . . ., n-1, 0. I've looked at the coordinates and changed the camera and lots of other things, and I have no idea what is wrong. The code that draws the billboards is below; the class that draws the billboards is called Gallery. (I can provide the rest of the application upon request.) If anyone has any ideas for me at all, even for what might be wrong or something else to help me diagnose the problem, I would be very grateful! Thank you, Shari #!/usr/binh/env python2.5 import wx import Image from wx import glcanvas import wx.lib.scrolledpanel as scrolled import wx.lib.statbmp as statbmp import wx.lib.buttons as buttons from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * from vtk.wx.wxVTKRenderWindow import * import appData.appData import vizGenerator.vizEngine MAP_FILE_NAME = "/home/shari/thesisFiles/testSet.cod" DATA_FILE_NAME = "/home/shari/thesisFiles/schoolData.vtk" MAX_HISTORY_SIZE = 1000 class MyGlCanvas(glcanvas.GLCanvas): def __init__(self, parent): glcanvas.GLCanvas.__init__(self, parent, -1) self.init = False # initial mouse position self.lastx = self.x = 30 self.lasty = self.y = 30 self.size = None self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_PAINT, self.OnPaint) self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown) self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp) self.Bind(wx.EVT_MOTION, self.OnMouseMotion) def OnEraseBackground(self, event): pass # Do nothing, to avoid flashing on MSW. def OnSize(self, event): size = self.size = self.GetClientSize() if self.GetContext(): self.SetCurrent() glViewport(0, 0, size.width, size.height) event.Skip() def OnPaint(self, event): dc = wx.PaintDC(self) self.SetCurrent() if not self.init: self.InitGL() self.init = True self.OnDraw() def OnMouseDown(self, evt): self.CaptureMouse() self.x, self.y = self.lastx, self.lasty = evt.GetPosition() def OnMouseUp(self, evt): self.ReleaseMouse() def OnMouseMotion(self, evt): if evt.Dragging() and evt.LeftIsDown(): self.lastx, self.lasty = self.x, self.y self.x, self.y = evt.GetPosition() self.Refresh(False) class Gallery(MyGlCanvas): vizImageIds = [] xMapSize = 0 yMapSize = 0 width = 0.1 # Length of a billboard height = 0.1 # Height of a billboard distX = 0.1 # Distance between billboards in the x direction distZ = 0.15 # Distance between billboards in the z direction myVizEngine = vizGenerator.vizEngine.vizEngine(MAP_FILE_NAME, DATA_FILE_NAME) # TODO: Put these back! #xMapSize = int(myVizEngine.mapMatrix.sizeX) #yMapSize = int(myVizEngine.mapMatrix.sizeY) xMapSize = 3 yMapSize = 3 billboardList = 0 def InitGL(self): print "In Gallery.InitGL" self.SetCurrent() glClearColor(0.7, 0.7, 0.7, 0.0) glShadeModel(GL_FLAT) glEnable(GL_DEPTH_TEST) glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB) self.vizImageIds = glGenTextures(self.xMapSize * self.yMapSize + 1) self.CreateDisplayList() glMatrixMode(GL_PROJECTION) glLoadIdentity() # Calculate the aspect ratio of the window size = self.size = self.GetClientSize() gluPerspective(80.0, float(size.width) / float(size.height), 0.01, 20.0) print "GL Error after gluPerspective: ", glGetError() glMatrixMode(GL_MODELVIEW) glLoadIdentity() glClearColor(0.7, 0.7, 0.7, 0.0) glEnable(GL_DEPTH_TEST) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) self.LookAt(0, 0) def OnDraw(self): self.SetCurrent() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glCallList(self.billboardList) glFlush() self.SwapBuffers() def DrawBillboard(self, x, y, z, filename, textureCount): self.textureId = self.LoadImage(filename, textureCount) self.SetupTexture(textureCount) glBindTexture(GL_TEXTURE_2D, self.vizImageIds[textureCount]) #glMatrixMode(GL_MODELVIEW) #glLoadIdentity() glBegin(GL_QUADS) coords = self.GetBillboardCoordinates(x, z) leftX = coords[0] rightX = coords[1] bottomY = coords[2] topY = coords[3] z = coords[4] #print "Drawing billboard at ", x, y, z print "Billboard position: ", leftX, rightX, bottomY, topY, z glNormal3f(0.0, 0.0, -1.0) glTexCoord2f(0.0, 0.0); glVertex3f(leftX, bottomY, z) glTexCoord2f(1.0, 0.0); glVertex3f(rightX, bottomY, z) glTexCoord2f(1.0, 1.0); glVertex3f(rightX, topY, z) glTexCoord2f(0.0, 1.0); glVertex3f(leftX, topY, z) #glTexCoord2f(0.0, 0.0); glVertex3f(leftX, bottomY, z) #glTexCoord2f(0.0, 1.0); glVertex3f(leftX, topY, z) #glTexCoord2f(1.0, 1.0); glVertex3f(rightX, topY, z) #glTexCoord2f(1.0, 0.0); glVertex3f(rightX, bottomY, z) glEnd() def GetBillboardCoordinates(self, x, z): #leftX = (self.xMapSize * self.distX) - (x * self.distX) + (self.xMapSize * self.width) - (x * self.width) leftX = -x * (self.distX + self.width) - self.width rightX = leftX + self.width bottomY = 0 topY = bottomY + self.height zCoord = (self.distZ * self.yMapSize) - (z + 1) * self.distZ print "In GetBillboardCoordinates, zCoord is ", zCoord return leftX, rightX, bottomY, topY, zCoord def SetupTexture(self, textureId): glEnable(GL_TEXTURE_2D) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL) glBindTexture(GL_TEXTURE_2D, self.vizImageIds[textureId]) # Added 20061003 def LoadImage(self, filename, id): #print "In LoadImage, filename is ", filename # First, load bitmap if filename == None: return None textureImageFile = None textureImageFile = open(filename, 'r') if textureImageFile: textureImageFile.close() im = Image.open(filename) # The images are mirrored, so flip it so they look the same #im = im.transpose(Image.FLIP_LEFT_RIGHT) try: ix, iy, image = im.size[0], im.size[1], im.tostring("raw", "RGBA", 0, -1) except SystemError: ix, iy, image = im.size[0], im.size[1], im.tostring("raw", "RGBX", 0, -1) else: print "ERROR - Image File not found" glPixelStorei(GL_UNPACK_ALIGNMENT, 1) glTexImage2D(GL_TEXTURE_2D, 0, 3, ix, iy, 0, GL_RGBA, GL_UNSIGNED_BYTE, image) return self.vizImageIds[id] def CreateDisplayList(self): self.billboardList = glGenLists(1) glNewList(self.billboardList, GL_COMPILE) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); # Draw a matrix of billboards textureCount = 0 for x in range(0, self.xMapSize): for z in range(0, self.yMapSize): textureFilename = self.myVizEngine.getViz([x, z]) y = 0 print "Drawing billboard for filename", textureFilename self.DrawBillboard(x, y, z, textureFilename, textureCount) textureCount += 1 # gluLookAt(0.2, 0.05, 0.01, # 0.2, 0.05, 0.1, # 0, 1, 0) glColor3f(0.0, 1.0, 0.0) # green for x axis glBegin(GL_LINES) #glLineStipple(1, 0x0101) # dotted glVertex3f(0.0, 0.0, 0.0) glVertex3f(-2.0, 0.0, 0.0) glEnd() glColor3f(1.0, 0.0, 0.0) # red for z axis glBegin(GL_LINES) #glLineStipple(1, 0x00FF) # dashed glVertex3f(0.0, 0.0, 0.0) glVertex3f(0.0, 0.0, 2.0) glEnd() glFlush() glEndList() def SetPosition(self, camX, camY, camZ, viewX, viewY, viewZ): """Sets the viewpoint at which to look Called when the user moves from one location to another""" print "In Gallery.SetPosition" self.SetCurrent() # Viewing transformation print "Camera: ", camX, camY, camZ print "View: ", viewX, viewY, viewZ glMatrixMode(GL_MODELVIEW) glLoadIdentity() gluLookAt(camX, camY, camZ, # camera position viewX, viewY, viewZ , # camera aimed at 0.0, 1.0, 0.0) # view-up matrix self.OnDraw() #self.SwapBuffers() def LookAt(self, x, z): """Positions the camera and viewpoint to look at the billboard at array position (x, z)""" print "Looking at position: ", x, z #self.SetCurrent() coords = self.GetBillboardCoordinates(x, z) leftX = coords[0] rightX = coords[1] bottomY = coords[2] topY = coords[3] z = coords[4] billboardX = (leftX + rightX) / 2 billboardY = (bottomY + topY) / 2 billboardZ = z print "In LookAt, billboard position = ", billboardX, billboardY, billboardZ #billboardZ = (z - 1) * self.distZ camX = billboardX camY = billboardY #camZ = billboardZ - (self.distZ / 5.0) #camZ = billboardZ - ((self.distZ / 4.0) * 3) # Step back 3/4 of the way to the next billboard camZ = billboardZ + (self.distZ * 0.8) #- self.distZ / 4.0 self.SetPosition(camX, camY, camZ, billboardX, billboardY, billboardZ) #self.SwapBuffers() def getVizEngine(self): return self.myVizEngine class CubeCanvas(MyGlCanvas): def InitGL(self): print "In CubeCanvas.InitGL" # set viewing projection glMatrixMode(GL_PROJECTION) glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 3.0) # position viewer glMatrixMode(GL_MODELVIEW) glTranslatef(0.0, 0.0, -2.0) # position object glRotatef(self.y, 1.0, 0.0, 0.0) glRotatef(self.x, 0.0, 1.0, 0.0) glEnable(GL_DEPTH_TEST) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) def OnDraw(self): print "In CubeCanvas.OnDraw" # clear color and depth buffers glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # draw six faces of a cube glBegin(GL_QUADS) glNormal3f( 0.0, 0.0, 1.0) glVertex3f( 0.5, 0.5, 0.5) glVertex3f(-0.5, 0.5, 0.5) glVertex3f(-0.5,-0.5, 0.5) glVertex3f( 0.5,-0.5, 0.5) glNormal3f( 0.0, 0.0,-1.0) glVertex3f(-0.5,-0.5,-0.5) glVertex3f(-0.5, 0.5,-0.5) glVertex3f( 0.5, 0.5,-0.5) glVertex3f( 0.5,-0.5,-0.5) glNormal3f( 0.0, 1.0, 0.0) glVertex3f( 0.5, 0.5, 0.5) glVertex3f( 0.5, 0.5,-0.5) glVertex3f(-0.5, 0.5,-0.5) glVertex3f(-0.5, 0.5, 0.5) glNormal3f( 0.0,-1.0, 0.0) glVertex3f(-0.5,-0.5,-0.5) glVertex3f( 0.5,-0.5,-0.5) glVertex3f( 0.5,-0.5, 0.5) glVertex3f(-0.5,-0.5, 0.5) glNormal3f( 1.0, 0.0, 0.0) glVertex3f( 0.5, 0.5, 0.5) glVertex3f( 0.5,-0.5, 0.5) glVertex3f( 0.5,-0.5,-0.5) glVertex3f( 0.5, 0.5,-0.5) glNormal3f(-1.0, 0.0, 0.0) glVertex3f(-0.5,-0.5,-0.5) glVertex3f(-0.5,-0.5, 0.5) glVertex3f(-0.5, 0.5, 0.5) glVertex3f(-0.5, 0.5,-0.5) glEnd() if self.size is None: self.size = self.GetClientSize() w, h = self.size w = max(w, 1.0) h = max(h, 1.0) xScale = 180.0 / w yScale = 180.0 / h glRotatef((self.y - self.lasty) * yScale, 1.0, 0.0, 0.0); glRotatef((self.x - self.lastx) * xScale, 0.0, 1.0, 0.0); self.SwapBuffers() class CurrentView(wx.Panel): def __init__(self, parent): print "Entering CurrentView.__init__" self.parent = parent # self.position = [self.parent.currAppData.position.x, # self.parent.currAppData.position.z] wx.Panel.__init__(self, self.parent, style=wx.BORDER_SUNKEN, size=(60, 200)) box = wx.BoxSizer(wx.VERTICAL) self.widget = wxVTKRenderWindow(self, -1, pos=(100, 100), size=(170, 170)) self.myVizEngine = vizGenerator.vizEngine.vizEngine(MAP_FILE_NAME, DATA_FILE_NAME) #ren = self.myVizEngine.getVtkViz(self.position) #self.widget.GetRenderWindow().AddRenderer(ren) self.OnDraw() box.Add(self.widget, 0, wx.ALIGN_RIGHT) self.SetSizer(box) print "CurrentView.__init__ has completed" def SetPosition(self, position): self.position = position def OnDraw(self): print "In CurrentView.OnDraw" self.position = [self.parent.currAppData.position.x, self.parent.currAppData.position.z] print "Position is ", self.position self.widget = wxVTKRenderWindow(self, -1, pos=(100, 100), size=(170, 170)) #myVizEngine = vizGenerator.vizEngine.vizEngine(MAP_FILE_NAME, DATA_FILE_NAME) ren = self.myVizEngine.getVtkViz(self.position) #renWin = self.widget.GetRenderWindow() #renWin.AddRenderer(ren) self.widget.GetRenderWindow().AddRenderer(ren) # self.widget.GetRenderWindow().Render() #self.widget.Render() # renWin.Render() # # camera = ren.GetActiveCamera() # camera.SetViewUp(1, 0, 0) # ren.SetActiveCamera(camera) #self.widget.Render() #self.widget.GetRenderWindow().Render() print "Finished CurrentView.OnDraw" class HistoryView(scrolled.ScrolledPanel): #class HistoryView(wx.ScrolledWindow): SPACING = 1 def __init__(self, parent): # wx.ScrolledWindow.__init__(self, parent, id=-1, pos=wx.DefaultPosition, # size=(700, 100), style=wx.HSCROLL, # name="History View") scrolled.ScrolledPanel.__init__(self, parent, -1, size=(840, 300)) #self.SetSize((700, 100)) #self.panel = wx.Panel(self, style=wx.BORDER_SUNKEN, size=(700, 100)) #self.navigationWin = navigationWin self.parent = parent self.history = self.parent.currAppData.history self.boxSizer = wx.BoxSizer(wx.HORIZONTAL) self.boxSizer.SetMinSize((600, 200)) self.myVizEngine = vizGenerator.vizEngine.vizEngine(MAP_FILE_NAME, DATA_FILE_NAME) # Add initial position to history print "Adding initial position: ", self.parent.currAppData.position self.AddPosition(self.parent.currAppData.position) #self.OnDraw() self.SetSizerAndFit(self.boxSizer) #self.SetSizer(self.boxSizer) self.SetupScrolling(scroll_x=True, scroll_y=False) self.boxSizer.Fit(self) def AddPosition(self, position): print "In HistoryView.AddPosition, adding position ", position historyButton = HistoryButton(self, position, self.myVizEngine) self.boxSizer.Add(historyButton, 0, wx.ALL, self.SPACING) self.boxSizer.Layout() self.boxSizer.FitInside(self) class HistoryButton(buttons.GenBitmapButton): SCALE_FACTOR = 0.75 def __init__(self, parent, position, vizEngine): self.position = position print "Button created with position: ", self.position.toString() self.parent = parent textureFilename = vizEngine.getViz([position.x, position.z]) image = wx.Image(textureFilename, wx.BITMAP_TYPE_BMP) #image = wx.Bitmap(textureFilename) width = image.GetWidth() height = image.GetHeight() #print "Image Size: ", width, height scaledImage = image.Scale(width * self.SCALE_FACTOR, height * self.SCALE_FACTOR) bitmapImage = scaledImage.ConvertToBitmap() buttons.GenBitmapButton.__init__(self, parent, -1, bitmapImage, pos=(0, 0), style=0) self.Bind(wx.EVT_BUTTON, self.OnClick, self) def OnClick(self, event): print "Button Position: ", self.position.toString() self.parent.parent.navigationPanel.OnStep(self.position) #class CurrentView(wx.Panel): # def __init__(self, parent): # print "Entering CurrentView.__init__" # self.parent = parent # self.position = [self.parent.currAppData.position.x, # self.parent.currAppData.position.z] # # wx.Panel.__init__(self, parent, style=wx.BORDER_SUNKEN) # box = wx.BoxSizer(wx.VERTICAL) # self.widget = wxVTKRenderWindow(self, -1, pos=(100, 100), size=(170, 170)) # myVizEngine = vizGenerator.vizEngine.vizEngine(MAP_FILE_NAME, DATA_FILE_NAME) # ren = myVizEngine.getVtkViz(self.position) # # self.widget.GetRenderWindow().AddRenderer(ren) # # box.Add(self) # # self.SetSizer(box) # print "Leaving CurrentView.__init__" # def OnDraw(self): # print "In CurrentView.OnDraw" # self.position = [self.parent.currAppData.position.x, # self.parent.currAppData.position.z] # myVizEngine = vizGenerator.vizEngine.vizEngine(MAP_FILE_NAME, DATA_FILE_NAME) # ren = myVizEngine.getVtkViz(self.position) #class CurrentView(wx.Panel): # def __init__(self, parent): # print "Entering CurrentView.__init__" # wx.Panel.__init__(self, parent, style=wx.BORDER_SUNKEN) # self.widget = wxVTKRenderWindow(self, -1, pos=(100, 100), size=(170, 170)) # print "Leaving CurrentView.__init__" # # def OnDraw(self): # print "Entering CurrentView.OnDraw" # cylinder = vtk.vtkCylinderSource() # cylinder.SetResolution(8) # cylinderMapper = vtk.vtkPolyDataMapper() # cylinderMapper.SetInput(cylinder.GetOutput()) # cylinderActor = vtk.vtkActor() # cylinderActor.SetMapper(cylinderMapper) # cylinderActor.GetProperty().SetColor(1.0000, 0.3882, 0.2784) # cylinderActor.RotateX(30.0) # cylinderActor.RotateY(-45.0) # # ren1 = vtk.vtkRenderer() # renWin = vtk.vtkRenderWindow() # renWin.AddRenderer(ren1) # iren = vtk.vtkRenderWindowInteractor() # iren.SetRenderWindow(renWin) # # ren1.AddActor(cylinderActor) # ren1.SetBackground(0.1, 0.2, 0.4) # renWin.SetSize(200, 200) ## iren.Initialize() ## iren.Start() # # self.widget.GetRenderWindow().AddRenderer(ren1) |
From: Mike C. F. <mcf...@vr...> - 2008-07-27 21:38:01
|
iRobot iRobot wrote: > I try to install PyOpenGL-3.0.0b4 by typing 'python setup.py install' > it's running and display its processing status. > But when it display 'Extracting PyOpenGL-3.0.0b4-py2.5.egg to > g:\python25\lib\site-packages', > it said one file in the sub-directory \OpenGL\arrays\vbo-junk.py' has > error at line 2. And display > <<<<<<< vbo.py > ^ > SyntaxError: invalid syntax > And then it ends up. > I ignore it but I found that I can't use PyOpenGL (running the > tutorial file 3 provided by PyODE). > > I try to look at the vbo_junk.py and found that there are many unknown > command > like '<<<<<<< vbo' and '>>>>>>> 1.5' at various part inside the file. > > I don't know what is the problem here. Can anyone help? > > I have install python2.5 and the latest version of ez_setup. > I fail with both the command 'easy_install PyOpenGL' and 'python > setup.py install', end up with the same screen. > > I have try in the WinXp and Win98 platform and end up with the same > result. This was a very silly error on my part. The junk file was supposed to be deleted when I finished replacing it, but it never got removed. I've just released a (very lightly tested) PyOpenGL-3.0.0b5 package that fixes this and another bug. If you can't download again, just deleting the offending file from the source directory should eliminate the problem. HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |