pyopengl-users Mailing List for PyOpenGL (Page 110)
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: Rene L. <R.L...@gm...> - 2002-01-22 08:23:30
|
root wrote: > > Hello, > > I am trying to use PyOpenGL for the first time and I am having trouble > building it. After I run 'python setup.py build', it compiles for a > minute, and then exits with the error below. > > This error does not make sense to me, because I have other applications > running that use the GL library, and I have no problem with them. I can > compile and link them with no errors. > > The error is: > > gcc -O3 -fomit-frame-pointer -pipe -s -march=pentium -ffast-math > -fexpensive-optimizations -fPIC -DGLX_PLATFORM -I/usr/include > -I/usr/local/include -I/usr/X11/include -Isrc/gle/src > -I/usr/include/python1.5 -c src/interface/GL.ARB.matrix_palette.c -o > build/temp.linux-i686-1.5/GL.ARB.matrix_palette.o > gcc -shared build/temp.linux-i686-1.5/GL.ARB.matrix_palette.o -L/usr/lib > -L/usr/local/lib -L/usr/X11/lib -Lbuild/temp.linux-i686-1.5 -lGL -lX11 > -lXext -lGLU -linterface_util -lGLE -o > build/lib.linux-i686-1.5/OpenGL/GL/ARB/matrix_palette.so > /usr/bin/ld: cannot find -lGL > collect2: ld returned 1 exit status > error: command 'gcc' failed with exit status 1 > > I'm running Mandrake Linux. Any suggestions would be much appreciated!! > > -- Jake You should check if there is a directory or link /usr/X11. If not just create the link as in #ls -l /usr lrwxrwxrwx 1 root root 5 Dez 17 14:20 X11 -> X11R6 drwxr-xr-x 8 root root 159 Dez 17 14:21 X11R6 Rene |
|
From: root <jpr...@ca...> - 2002-01-21 22:34:08
|
Hello, I am trying to use PyOpenGL for the first time and I am having trouble building it. After I run 'python setup.py build', it compiles for a minute, and then exits with the error below. This error does not make sense to me, because I have other applications running that use the GL library, and I have no problem with them. I can compile and link them with no errors. The error is: gcc -O3 -fomit-frame-pointer -pipe -s -march=pentium -ffast-math -fexpensive-optimizations -fPIC -DGLX_PLATFORM -I/usr/include -I/usr/local/include -I/usr/X11/include -Isrc/gle/src -I/usr/include/python1.5 -c src/interface/GL.ARB.matrix_palette.c -o build/temp.linux-i686-1.5/GL.ARB.matrix_palette.o gcc -shared build/temp.linux-i686-1.5/GL.ARB.matrix_palette.o -L/usr/lib -L/usr/local/lib -L/usr/X11/lib -Lbuild/temp.linux-i686-1.5 -lGL -lX11 -lXext -lGLU -linterface_util -lGLE -o build/lib.linux-i686-1.5/OpenGL/GL/ARB/matrix_palette.so /usr/bin/ld: cannot find -lGL collect2: ld returned 1 exit status error: command 'gcc' failed with exit status 1 I'm running Mandrake Linux. Any suggestions would be much appreciated!! -- Jake |
|
From: Larry C. <cu...@io...> - 2002-01-19 05:33:48
|
I'm working in Win98. Is there a way to open a window and draw into it directly using PyOpenGL commands instead of using Tkinter and setting up callback functions for redrawing, etc. ? Any help in this regard would be most appreciated. Thank you. Larry Cuba |
|
From: <no...@so...> - 2002-01-17 09:25:32
|
Feature Requests item #452946, was opened at 2001-08-19 08:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=452946&group_id=5988 Category: new module Group: v2.1 Status: Open Resolution: None Priority: 3 Submitted By: Tarn Weisner Burton (twburton) Assigned to: Tarn Weisner Burton (twburton) Summary: Font modules Initial Comment: Create font modules. Targets: bitmap + outline. It would be nice if out lines could be sent to GLE methods: 1) wrap GLTT (see http://gltt.sf.net) -> under GPL! Also doesn't interface with GLE 2) Use PyFT to create own variant of GLTT. Problem with this is that PyFT is under GPL, even though Freetype can be used with either BSD/GPL. Also PyFT is Freetype1 not Freetype2. 3) Wrap Freetype2 and write own python code. 4) write own C version of GLTT that uses Freetype. 5) Use python FontTools? (No rasterizer) 6) expose platform specific bitmap font capabilities through WGL, AGL, GLX, etc. or come up with common call. ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-17 01:25 Message: Logged In: YES user_id=34901 Another possible option: http://oglft.sourceforge.net/ -- LGPL, (apparently) same basic functionality as GLTT, based on FreeType2. Claims to be 0.0 status, but has what looks to be fairly close to a completed OGLFT.CPP (haven't tested it's functionality, just browsed the code). Note that it's C++, not C, code. By the look of it, could be its own module, rather than being part of the base PyOpenGL module (especially given the license), as it's interactions are all self-contained (you pass in strings, booleans, etceteras, there's no arrays/callbacks). Has all the bells+whistles you'd want (multiple 2D and 3D formats, extrusions with GLE, use of truetype, etceteras). ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-17 01:02 Message: Logged In: YES user_id=34901 Another possible option: http://oglft.sourceforge.net/ -- LGPL, (apparently) same basic functionality as GLTT, based on FreeType2. Claims to be 0.0 status, but has what looks to be fairly close to a completed OGLFT.CPP (haven't tested it's functionality, just browsed the code). Note that it's C++, not C, code. By the look of it, could be its own module, rather than being part of the base PyOpenGL module (especially given the license), as it's interactions are all self-contained (you pass in strings, booleans, etceteras, there's no arrays/callbacks). Has all the bells+whistles you'd want (multiple 2D and 3D formats, extrusions with GLE, use of truetype, etceteras). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=452946&group_id=5988 |
|
From: <no...@so...> - 2002-01-17 09:02:41
|
Feature Requests item #452946, was opened at 2001-08-19 08:00 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=452946&group_id=5988 Category: new module Group: v2.1 Status: Open Resolution: None Priority: 3 Submitted By: Tarn Weisner Burton (twburton) Assigned to: Tarn Weisner Burton (twburton) Summary: Font modules Initial Comment: Create font modules. Targets: bitmap + outline. It would be nice if out lines could be sent to GLE methods: 1) wrap GLTT (see http://gltt.sf.net) -> under GPL! Also doesn't interface with GLE 2) Use PyFT to create own variant of GLTT. Problem with this is that PyFT is under GPL, even though Freetype can be used with either BSD/GPL. Also PyFT is Freetype1 not Freetype2. 3) Wrap Freetype2 and write own python code. 4) write own C version of GLTT that uses Freetype. 5) Use python FontTools? (No rasterizer) 6) expose platform specific bitmap font capabilities through WGL, AGL, GLX, etc. or come up with common call. ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-17 01:02 Message: Logged In: YES user_id=34901 Another possible option: http://oglft.sourceforge.net/ -- LGPL, (apparently) same basic functionality as GLTT, based on FreeType2. Claims to be 0.0 status, but has what looks to be fairly close to a completed OGLFT.CPP (haven't tested it's functionality, just browsed the code). Note that it's C++, not C, code. By the look of it, could be its own module, rather than being part of the base PyOpenGL module (especially given the license), as it's interactions are all self-contained (you pass in strings, booleans, etceteras, there's no arrays/callbacks). Has all the bells+whistles you'd want (multiple 2D and 3D formats, extrusions with GLE, use of truetype, etceteras). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=452946&group_id=5988 |
|
From: Mike C. F. <mcf...@ro...> - 2002-01-16 03:18:58
|
Not sure if others were interested in it, but I just checked in a method for OpenGLContext.quaternion.Quaternion that lets you do spherical linear interpolation (slerp) between two quaternions. This is useful if you want to animate between two rotations using fractional values. I'm thinking I may try to grok the spline-on-rotation interpolation code (so that with 5 or 6 rotations you get a nice fit curve that doesn't make the rotations mechanically switch direction at the sample points). It looks pretty hairy though, so might just leave it with slerp. Enjoy yourselves, Mike _______________________________________ Mike C. Fletcher http://members.rogers.com/mcfletch/ |
|
From: <no...@so...> - 2002-01-16 03:08:33
|
Feature Requests item #457330, was opened at 2001-08-31 10:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 Category: None Group: v2.1 Status: Closed Resolution: Accepted Priority: 4 Submitted By: Mike C. Fletcher (mcfletch) Assigned to: Mike C. Fletcher (mcfletch) Summary: Quaternion SLERP Initial Comment: Would be nice to have a Quaternion SLERP function such that firstQuat.SLERP( secondQuat, fraction) would return the appropriate Quaternion representing the fractional rotation between the two Quaternions. ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:08 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:07 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:06 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 |
|
From: <no...@so...> - 2002-01-16 03:07:54
|
Feature Requests item #457330, was opened at 2001-08-31 10:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 Category: None Group: v2.1 Status: Closed Resolution: Accepted Priority: 4 Submitted By: Mike C. Fletcher (mcfletch) Assigned to: Mike C. Fletcher (mcfletch) Summary: Quaternion SLERP Initial Comment: Would be nice to have a Quaternion SLERP function such that firstQuat.SLERP( secondQuat, fraction) would return the appropriate Quaternion representing the fractional rotation between the two Quaternions. ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:07 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:06 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 |
|
From: <no...@so...> - 2002-01-16 03:06:22
|
Feature Requests item #457330, was opened at 2001-08-31 10:51 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 Category: None Group: v2.1 >Status: Closed >Resolution: Accepted Priority: 4 Submitted By: Mike C. Fletcher (mcfletch) Assigned to: Mike C. Fletcher (mcfletch) Summary: Quaternion SLERP Initial Comment: Would be nice to have a Quaternion SLERP function such that firstQuat.SLERP( secondQuat, fraction) would return the appropriate Quaternion representing the fractional rotation between the two Quaternions. ---------------------------------------------------------------------- >Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:06 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 |
|
From: Jan E. <ch...@in...> - 2002-01-09 08:55:15
|
On Tue, 8 Jan 2002, Frank Raiser wrote:
>I managed to create the strings using the struct module and they worked
>exactly the same as glVertexPointerf and glColorPointerf. But when
>trying to do the same with glTexCoordPointer I got back my beloved
>1282 invalid operation error.
>It's interesting however that I get the very same error when f.ex. producing
>an actual error by not enabling GL_TEXTURE_2D or the texcoord array. This makes
>me think I might have missed something essential? Although I wouldn't know
>what. The texture setup is taken from a working example (well just the 4 lines
>setting it up until glTexImage2D). And I enabled GL_TEXTURE_2D and
>GL_TEXTURE_COORD_ARRAY. Any ideas?
Does anybody know of any way to get better error messages? Or just have it
throw an exception with some more context information? This is probably
not the fault of PyOpenGL, but it's the way OpenGL/Mesa works.
I'm quite sure that all recent versions of Mesa (as Frank most likely
uses) have the glTexCoordPointer() function, so the error (again, I think)
is somewhere when PyOpenGL talks to Mesa?
--
The Emperor had all the qualifications for a corpse except, as it were, the
most vital one.
-- Terry Pratchett, Interesting Times
|
|
From: Les S. <sch...@op...> - 2002-01-08 22:45:24
|
i guess you meant: http://pyopengl.sourceforge.net/ftp/PyOpenGL-2.0.1.46.a1.tar.gz this built to completion and seems to work fine with python2.2 in terms of CVS builds, i upgraded swig from 1.3.9 to 1.3.10 and got many warnings (deprecations) and then more failure. so i guess i'm stickin with an alpha for now ;-) les schaffer |
|
From: Tarn W. B. <twb...@us...> - 2002-01-08 22:32:09
|
There's a newer version in the ftp folder. Try http://pyopengl.sf.net/ftp/PyOpenGL-2.0.1.45.alpha.tar.gz Also, you need SWIG 1.3a5 to build out of CVS. Tarn |
|
From: Les S. <sch...@op...> - 2002-01-08 21:57:05
|
in th email archives there is a reference to a set of patches for getting OpenGL to compile with NVIDIA headers: http://pyopengl.sf.net/ftp/PyOpenGL-2.0.1.45.alpha.tar.gz but i get a file not found response. do these patches still exist? i tried CVS but it does while swigging swig -python -Iinterface -shadow -DAPI_VERSION=257 -o src/interface/GL.__init___.0101.inc interface/GL/__init__.i Syntax error interface/GL/__init__.i:1006. Syntax error in input. thanks les schaffer |
|
From: Frank R. <cra...@gm...> - 2002-01-08 15:13:44
|
I managed to create the strings using the struct module and they worked exactly the same as glVertexPointerf and glColorPointerf. But when trying to do the same with glTexCoordPointer I got back my beloved 1282 invalid operation error. It's interesting however that I get the very same error when f.ex. producing an actual error by not enabling GL_TEXTURE_2D or the texcoord array. This makes me think I might have missed something essential? Although I wouldn't know what. The texture setup is taken from a working example (well just the 4 lines setting it up until glTexImage2D). And I enabled GL_TEXTURE_2D and GL_TEXTURE_COORD_ARRAY. Any ideas? -- Raiser, Frank aka CrashChaos IRC: irc.openprojects.net #pygame |
|
From: Frank R. <cra...@gm...> - 2002-01-08 08:51:15
|
On Tue, Jan 08, 2002 at 12:06:25AM -0500, Mike C. Fletcher wrote: > The format for the string versions of array functions is the same as for > a C array. That is, it's the internal format of the array (not how you > would write it in a C program). For instance, the point (1.0, 2.0, 3.0) > would be represented as: > > '\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x08@' > (with \x00 meaning a byte with the value (hexidecimal) 0, \x08 being a > byte with character number 8, etceteras) Ok thanks. I'm gonna try using this if I can't get glTexCoordPointerf to work. > So, how do you use those functions? Well, here's an example: I already got everything working with the vertex and color arrays. My only problem is that the call to glTexCoordPointerf returns an invalid operation error. The rest works splendidly. Although I wonder if using glTexCoordPointer with a struct generated string will not just repeat that error. I'm gonna take a look at this later. Thanks for your help, -- Raiser, Frank aka CrashChaos IRC: irc.openprojects.net #pygame Windows is the one true OS. MS invented the GUI. MS invented the 32 bit OS. MS is open and standard. MS loves you. We have always been at war with Oceana. |
|
From: Mike C. F. <mcf...@ro...> - 2002-01-08 05:03:10
|
The format for the string versions of array functions is the same as for a C array. That is, it's the internal format of the array (not how you would write it in a C program). For instance, the point (1.0, 2.0, 3.0) would be represented as: '\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x08@' (with \x00 meaning a byte with the value (hexidecimal) 0, \x08 being a byte with character number 8, etceteras) (I didn't figure that out on my own by the way, I used the struct module). You _could_ convert your data to that format by using the struct module, but it's a lot of work to go through when the other functions will do the conversions for you. So, how do you use those functions? Well, here's an example: '''Test of the glDrawArrays function''' from OpenGLContext import testingcontext BaseContext, MainFunction = testingcontext.getInteractive() from OpenGL.GL import * from Numeric import array import string data = [ (0,0,0), (1,0,0), (1,1,0), (0,1,0), ] class TestContext( BaseContext): def Render( self, mode = 0): BaseContext.Render( self, mode ) glVertexPointerd( data ) glNormalPointerf([ (0,0,1)]*4 ) glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glDrawArrays(GL_QUADS, 0, len(data)) if __name__ == "__main__": MainFunction ( TestContext) <plug> That's taken from the OpenGLContext/tests directory (with a simpler set of data in your format substituted). You can find a lot of sample code in the tests directory that gives you examples of how to accomplish common tasks. </plug> Hope that helps, Mike Frank Raiser wrote: > On Sun, Jan 06, 2002 at 11:13:24AM -0600, Tarn Weisner Burton wrote: > >>All the PyOpenGL functions are documented in merged man pages at >>http://pyopengl.sourceforge.net/documentation/manual/ >> >>Although the only the prototypes for the decorated functions >>(glVertexPointerf, etc.) are given in the man pages, they are described >>in more detail in the user's manual. This documentation is also >>distributed with 2.0, with the exception of the merged man pages which >>will be included in the next version. >> > > I've checked these but couldn't really get anything new from it. > > >>In short, glVertexPointer is like the C function in that it takes a >>Python string and it respects the stride arguments (in the future it may >>use the buffer protocol also), whereas glVertexPointerf uses a Python >>array (or Numeric) and doesn't need stride arguments. >> > > How exactly does the string have to look like? > I tried having a list vertices = [] and calling vertices.extend([x,y,z]) > for each vertex, then did a repr(vertices)[1:-1].replace(',','') to get > a string of successive "x1 y1 z1 x2 y2 z2.." vertices, but that didn't > work at all with glVertexPointer. > > >>Sorry, haven't figured out the INVALID_OPERATION problem yet. >> > > :( This is giving me a headache as I just can't get any more info out. I > don't know what to check, why it is invalid.. nothing. > > Thanks for your help, > -- _______________________________________ Mike C. Fletcher http://members.rogers.com/mcfletch/ |
|
From: Tarn W. B. <twb...@us...> - 2002-01-07 21:15:49
|
The docs for the array funcs are at http://pyopengl.sourceforge.net/documentation/manual/users_guide-array.h tml The undecorated functions expect a string which is just raw data passed directly to the C function. Typical usage would be reading the data from a file and sending it directly to the C function without converting it to a Python array. For your app you need the decorated functions. Tarn |
|
From: Frank R. <cra...@gm...> - 2002-01-07 20:55:34
|
On Sun, Jan 06, 2002 at 11:13:24AM -0600, Tarn Weisner Burton wrote: > All the PyOpenGL functions are documented in merged man pages at > http://pyopengl.sourceforge.net/documentation/manual/ > > Although the only the prototypes for the decorated functions > (glVertexPointerf, etc.) are given in the man pages, they are described > in more detail in the user's manual. This documentation is also > distributed with 2.0, with the exception of the merged man pages which > will be included in the next version. I've checked these but couldn't really get anything new from it. > In short, glVertexPointer is like the C function in that it takes a > Python string and it respects the stride arguments (in the future it may > use the buffer protocol also), whereas glVertexPointerf uses a Python > array (or Numeric) and doesn't need stride arguments. How exactly does the string have to look like? I tried having a list vertices = [] and calling vertices.extend([x,y,z]) for each vertex, then did a repr(vertices)[1:-1].replace(',','') to get a string of successive "x1 y1 z1 x2 y2 z2.." vertices, but that didn't work at all with glVertexPointer. > Sorry, haven't figured out the INVALID_OPERATION problem yet. :( This is giving me a headache as I just can't get any more info out. I don't know what to check, why it is invalid.. nothing. Thanks for your help, -- Raiser, Frank aka CrashChaos IRC: irc.openprojects.net #pygame |
|
From: Richard J. <ric...@op...> - 2002-01-07 10:51:55
|
On Sun, 6 Jan 2002 23:59, Jan Ekholm wrote:
> On Sun, 6 Jan 2002, Richard Jones wrote:
> >Code (interchangeable python and C modules for frustum culling and octree
> >storage) attached :)
>
> Wow. This was a little bit more than I was asking for, but I humbly bow
> and will try to use your code. :) Thanks a lot for the code.
>
> Hmm, I tested your code now, and I don't get it. Nothing is inside the
> frustum, all points I give it are outside. Strange. maybe gluLookAt() is
> pure evil wrt these kinds of operations. I'll try to dig some more.
That's odd... I use code like:
# setup the projection matrix
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
# setup the projection
# calculate left/right and top/bottom clipping planes based the
# smallest square viewport
width, height = self.viewport
a = 9.0/min(width, height)
lr, tb = a*width, a*height
glFrustum(-lr, lr, -tb, tb, 50.0, 20000.0)
# and place the camera
x, y, z = self.ufo.x, self.ufo.y, self.ufo.z
# TODO: move the camera up over the UFO as it climbs
# TODO: figure if there is landscape between the camera and UFO
gluLookAt(x, y+200, z-600, x, y, z, 0, 1, 0)
self.frustum.calculate()
in my regular drawing loop. Note, this is obviously directly stolen from the
ufo code :)
> >You can also get this code by downloading the tarball from
> >http://goanna.adroit.net/~richard/ufo/ where there is some octree code
> > that uses the frustum culling too. Note that since I discovered that the
> > code is _significantly_ faster when it just draws _everything_ rather
> > than tries to cull, the current ufo.py doesn't actually call the frustum
> > or octree code. In a nutshell, define objects like the triangle object,
> > stuff them into the octree with octree.insertPolygon or
> > octree.insertObject for each of the object's bounding vertexes. The call
> > octree.render with the frustum and it calls each of the appropriate
> > sub-object's render() method.
>
> Ok. I was thinking about some kind of simplified octree myself, or mainly
> just do divide the terrain into, say, 16 pieces (4x4) and just cull those
> pieces. Should not be too much Python code each frame.
As I mentioned in my post to pygame, the timings I got were something like
this for a landscape stored in the octree:
No C: 7fps
C octree: 7fps
C frusum: 8fps
C triangle: 10fps
C octree&frustum: 8fps
C frustum&tri: 11fps
C octree&tri: 26fps
all: 41fps
... so there does seem to be some benefit in having the octree in C, but only
when coupled with the lower-level objects also being in C.
> >Note that I do _all_ my view projection manipulation in the projection
> >matrix, so I don't include the modelview matrix. It's simple enough to
> >un-comment the appropriate code though.
>
> I assume you mean the line:
>
> self.c = c = p * m
Yes, and I just realised that my C module doesn't actually do the mult. Sorry
about that...
// matrix mult those two to get the clipping matrix
// c = p *m
... uncommenting that line wouldn't do much :)
Richard
|
|
From: Tarn W. B. <twb...@us...> - 2002-01-06 17:13:41
|
All the PyOpenGL functions are documented in merged man pages at http://pyopengl.sourceforge.net/documentation/manual/ Although the only the prototypes for the decorated functions (glVertexPointerf, etc.) are given in the man pages, they are described in more detail in the user's manual. This documentation is also distributed with 2.0, with the exception of the merged man pages which will be included in the next version. In short, glVertexPointer is like the C function in that it takes a Python string and it respects the stride arguments (in the future it may use the buffer protocol also), whereas glVertexPointerf uses a Python array (or Numeric) and doesn't need stride arguments. Sorry, haven't figured out the INVALID_OPERATION problem yet. Tarn |
|
From: Frank R. <cra...@gm...> - 2002-01-06 15:38:22
|
Hello,
I'm new to OpenGL and made some pretty good experiences with
PyOpenGL so far. But now I've hit vertex arrays and there are
some points I'm consistently appearing problems with.
I'm using PyOpenGL 2.0.0.44 with pygame-1.3.
I now created a list of (x,y,z) tuples for my vertices and
a list of (u,v) tuples for the texture coords. I first
ignored textures and used glVertexPointerf only which
worked perfectly. But I couldn't get it to work using the
older(?) glVertexPointer.
The second problem is a little bit more complicated. I tried
to use glTexCoordPointerf with my list of texture coords.
To be able to do that I enabled the appropriate states and
generated a texture. But the whole app crashed when calling
glTexCoordPointerf(list_of_texcoords)
giving me an OpenGL error: Invalid operation
The same happened when I used the glTexCoordPointer method.
Here's the problem code used:
8<======
# just enabling the arrays
glEnableClientState(GL_VERTEX_ARRAY)
glEnableClientState(GL_COLOR_ARRAY)
glEnableClientState(GL_TEXTURE_COORD_ARRAY)
# prepare texturing
glEnable(GL_TEXTURE_2D)
self.textures = glGenTextures(2) # only first texture used in this sample
# create dummy texture
surf = pygame.Surface((64,64))
surf.subsurface((32,0,32,32)).fill((255,255,255))
surfdata = pygame.image.tostring(surf,"RGBX",1)
# setup the texture
glBindTexture(GL_TEXTURE_2D,self.textures[0])
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST)
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA, 64,64,0,GL_RGBA,GL_UNSIGNED_BYTE,surfdata)
vertices = [] # list of (x,y,z) tuples
mx,my = 50,50 # just a dimension to create 2601 vertices
colors = [] # list of (r,g,b) tuples
texcoords = [] # list of (u,v) tex coords
# a loop to get the appropriate values
for j in range(my+1):
for i in range(mx+1):
vertices.append((0.32*i,-0.32*j,0))
colors.append((random.random(),random.random(),random.random()))
texcoords.append( ( i%2, j%2 ) )
# prepare vertex arrays
# this works fine (also displays the expected output later)
glVertexPointerf(vertices)
# this doesn't work. leaves me with a blank screen
#glVertexPointer(3,GL_FLOAT,0,vertices)
# this works again (similar to the vertices)
glColorPointerf(colors)
# this line crashes with an invalid operation error
glTexCoordPointerf(texcoords)
# and this one crashes as well
#glTexCoordPointer(2,GL_FLOAT,0,texcoords)
=====>8
I appreciate any help I can get with this. I already tried RTFM and STFW
but couldn't find any fixes. Thanks.
|
|
From: Jan E. <ch...@in...> - 2002-01-06 12:59:32
|
On Sun, 6 Jan 2002, Richard Jones wrote: >Code (interchangeable python and C modules for frustum culling and octree >storage) attached :) Wow. This was a little bit more than I was asking for, but I humbly bow and will try to use your code. :) Thanks a lot for the code. Hmm, I tested your code now, and I don't get it. Nothing is inside the frustum, all points I give it are outside. Strange. maybe gluLookAt() is pure evil wrt these kinds of operations. I'll try to dig some more. >You can also get this code by downloading the tarball from >http://goanna.adroit.net/~richard/ufo/ where there is some octree code that >uses the frustum culling too. Note that since I discovered that the code is >_significantly_ faster when it just draws _everything_ rather than tries to >cull, the current ufo.py doesn't actually call the frustum or octree code. In >a nutshell, define objects like the triangle object, stuff them into the >octree with octree.insertPolygon or octree.insertObject for each of the >object's bounding vertexes. The call octree.render with the frustum and it >calls each of the appropriate sub-object's render() method. Ok. I was thinking about some kind of simplified octree myself, or mainly just do divide the terrain into, say, 16 pieces (4x4) and just cull those pieces. Should not be too much Python code each frame. >Note that I do _all_ my view projection manipulation in the projection >matrix, so I don't include the modelview matrix. It's simple enough to >un-comment the appropriate code though. I assume you mean the line: self.c = c = p * m -- Real stupidity beats artificial intelligence every time. -- Terry Pratchett, Hogfather |
|
From: Mike C. F. <mcf...@ro...> - 2002-01-06 05:43:19
|
This is a general problem with GUI IDEs under Windows. There are IDEs which can handle GUI running without interfering with the IDE itself (by running the application in a seperate process). Those are Boa, I think, and one of the for-pay IDEs as well, but PythonWin and IDLE are definitely not "GUI-safe". Good luck, Mike gabor farkas wrote: > hi, > > > i've just installed pyopengl ( windows xp, python 2.1 and after that > python 2.2 ) and i tryed to run some of the examples.. > > for example the lesson4 from the nehe tutorial... > > it worked... > > but then i tried to run it from an ide, like pythonwin... and it > didn't work, the application simply froze together with pythonwin. > > > after that i tried the dek/texturesurf example.. > > it worked well when opened from the command line ( "python > texturesurf.py" ), but when i try to run it from idle or pythonwin, > the first time it works ok, but when i try to run it again, it says > something like togl is an invalid name... i have to close and start > idle/pythonwin again, load in the file and run it. > > any ideas? > > gabor farkas > > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- _______________________________________ Mike C. Fletcher http://members.rogers.com/mcfletch/ |
|
From: gabor f. <xl...@po...> - 2002-01-06 00:28:58
|
hi, i've just installed pyopengl ( windows xp, python 2.1 and after that python 2.2 ) and i tryed to run some of the examples.. for example the lesson4 from the nehe tutorial... it worked... but then i tried to run it from an ide, like pythonwin... and it didn't work, the application simply froze together with pythonwin. after that i tried the dek/texturesurf example.. it worked well when opened from the command line ( "python texturesurf.py" ), but when i try to run it from idle or pythonwin, the first time it works ok, but when i try to run it again, it says something like togl is an invalid name... i have to close and start idle/pythonwin again, load in the file and run it. any ideas? gabor farkas |
|
From: Maciej K. <ma...@dg...> - 2002-01-05 23:42:38
|
On Sat, Jan 05, 2002 at 07:46:28AM -0500, Jan Ekholm wrote: > However, the Python versions return a [4][4] matrix, while the C versions > return a [16] array. The code on the page above uses a [16] array for all > indexing, so I'd like to translate the matrices I get from glGetFloatv to > arrays. > > The problem is now that I'm not sure how the returned matrix should be > "flattened". Should I go by row or column, i.e. the first element in the > array should be [0][0], but should the second be [0][1] or [1][0] and so > on? The OpenGL matrices are stored in column-major order. That is, the elements from the flat [16] array correspond to the 4x4 matrix like this: [ 0 4 8 12 ] [ 1 5 9 13 ] [ 2 6 10 14 ] [ 3 7 11 15 ] (Reference: "man" page for glMultMatrix) -- Maciej Kalisiak|mac@] dgp.toronto.edu|www.] "He who laughs last thinks slowest!" dgp.toronto.edu/~mac] |