pyopengl-users Mailing List for PyOpenGL (Page 91)
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: Eric B. <er...@bi...> - 2004-05-02 20:00:29
|
I'm using textured quads as map tiles in a 2D top-view game. I get "flickering" at the right and bottom edges of the tiles. Depending on how far in/out the map is zoomed, the effect is better or worse. I changed the texture coordinates from 1.0 to 0.98 in those vertices, and it helped a little, but not much. I'm sure there's a better solution...can anyone enlighten me? Right now I'm using GL_NEAREST_MIPMAP_LINEAR for the minifying filter, but I've tried the others too and I still have the problem. |
From: Reto S. <rsp...@no...> - 2004-04-29 08:43:05
|
In my opinion you can just use any 3d card around (nvidia or radeon). Depending on how much you want to spend, what output you need (vga, dvi etc.) you have to make your own desicion. This "VGA Card Buyer's Guide" may help you. http://www.tomshardware.com/graphic/20030714/vga_card_guide-01.html (my last info was that a geforce 5600 is of good price / performance value, but this may have changed in the last months) Nvidia runs well on linux & windows. As i havent had any radeon cards jet i cant tell how well they run (under linux). For recommendations on professional 3d cards (1000$ to 10'000$) you will have to ask someone else... Reto On Thursday 29 April 2004 03.30, Gary Herron wrote: > I'm starting a new project which will use OpenGL, and I'm looking for > recommendations on a good graphics card. We'll be using a fair number > of advanced features of OpenGL, so this is actually a request for > recommondations of both the hardware AND associated drivers which > support OpenGL well. > > Any suggestions? > > I realize this is slightly off topic, but I justify asking on this > group because I *read* this group, and I'll (at least) prototype the > project in Python/PyOpenGL. > > Thanks for any help, > Gary Herron -- ---------------------------------------------------------------------- Reto Spoerri rspoerri(ad)nouser.org http://www.nouser.org/ www.knoppix.tv where mices make the action |
From: Gary H. <gh...@is...> - 2004-04-29 01:30:56
|
I'm starting a new project which will use OpenGL, and I'm looking for recommendations on a good graphics card. We'll be using a fair number of advanced features of OpenGL, so this is actually a request for recommondations of both the hardware AND associated drivers which support OpenGL well. Any suggestions? I realize this is slightly off topic, but I justify asking on this group because I *read* this group, and I'll (at least) prototype the project in Python/PyOpenGL. Thanks for any help, Gary Herron |
From: enrike <en...@al...> - 2004-04-28 07:27:25
|
> BTW of course the code will be released, under the GPL or LGPL or some such > public open source license, we only have to write it first hehe > Oh and if any one would like to exchange notes on the subject or similar > ones (maybe a copy of the FMOD bindings?), I'd be delighted this would be great. We have been trying to find out a way to mix graphics with WxPython and looks like pyOpenGL is the most "normal" way to do it, however we just need to do 2d graphics and we felt that opengl was too much for us. So we had tro go back to pygame but there is no (crossplatform) way to make this run inside wxpython. So it would be great to have 2D in pyopengl in a easier way for those of us who cannot get that far ... but as I mentioned I dont think we can really help, its too complex for us, maybe just testing stuff? BTW, it would be great if yu manage to make it crossplatform. -- enrike :: |
From: <sn...@so...> - 2004-04-27 23:28:11
|
Wow, thank you everybody (Mike, Andrew, Enrique). Our spirits have been boosted, now we can hack at it some more until the next seemingly impassable obstacle :). Amos BTW of course the code will be released, under the GPL or LGPL or some such public open source license, we only have to write it first hehe Oh and if any one would like to exchange notes on the subject or similar ones (maybe a copy of the FMOD bindings?), I'd be delighted |
From: Andrew S. <str...@as...> - 2004-04-27 20:16:38
|
On Apr 26, 2004, at 10:43 PM, Mike C. Fletcher wrote: > sn...@so... wrote: > ... > >> perfectly). Now the last portion of the engine - for the initial >> release, at >> least - is the whole graphic shpiel. >> PyGame is very nice, I hope I'm not offending anyone - but it is, in >> my >> experience, a bit slow. OpenGL is fast (the demos seemed promising, I >> wrote >> a few quick programs and liked the resulting fps), and I figured I >> wouldn't >> mind going through some hoops to get OpenGL's speed into an oo-2d >> oriented >> interface. > > Oh, then, go for it, but keep in mind that you're dealing with a > system that thinks in terms of points, lines and triangles, so you're > going to have to do your own tessellating (though there are some tools > that will help with that, such as GLU). Also don't forget the glSDL backend, which could presumably be ported to pygame (if it hasn't already) a lot more easily than writing yet another graphics engine. |
From: Mike C. F. <mcf...@ro...> - 2004-04-27 05:43:57
|
sn...@so... wrote: ... > perfectly). Now the last portion of the engine - for the initial > release, at > least - is the whole graphic shpiel. > PyGame is very nice, I hope I'm not offending anyone - but it is, in my > experience, a bit slow. OpenGL is fast (the demos seemed promising, I > wrote > a few quick programs and liked the resulting fps), and I figured I > wouldn't > mind going through some hoops to get OpenGL's speed into an oo-2d > oriented > interface. Oh, then, go for it, but keep in mind that you're dealing with a system that thinks in terms of points, lines and triangles, so you're going to have to do your own tessellating (though there are some tools that will help with that, such as GLU). gluDisk gives you a simple filled circle if you set the inner radius to 0 setting gluQuadricDrawStyle to GLU_SILHOUETTE will give you empty circles (no fill) with gluDisk. You could also just use the sin and cos ufuncs from Numeric to generate coordinates and draw them using either an array-drawing call or a display list: a = arange(0.0,2*math.pi,.02) xes = sin(a) yes = cos(a) coords = zeros( (len(xes),3),'d') coords[:,0] = xes coords[:,1] = yes (the .02 there says to use .02 radians as the sampling rate, or around 1.1 degrees). As for drawing bitmaps, there's an ARB extension ARB.window_pos which gives simple positioning for bitmaps. There's also simple glDrawPixels (normally pretty slow) and loading a bitmap into a texture and displaying it on a properly-proportioned rectangle aligned with the screen (fast, and basically the "right" way to do it (IMO)). You might want to take a look at PyUI for sample code showing how to do this kind of stuff. IIRC it is using lots of simple orthogonal display of bitmaps, complex shapes (windows, text, etceteras) and is game-targeted. HTH, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: <sn...@so...> - 2004-04-27 05:00:17
|
> If this is really the limit of your interest, OpenGL is probably way too > big a hammer to pull out. Something like PyGame would likely be far > easier to work with, as it has all the device-context-style drawing > facilities most bitmap-oriented development would need. > > BTW, pyopengl-users-admin is the administrative account, you likely > wanted to send the query to pyopengl-users (copied on this message). > > Have fun, > Mike Oops, sorry, must have replied to the wrong message. Ok, so I'm not really writing a small game, but rather an engine - a protable 2d engine written in python that is fast and easy to use - or that was the plan :). I've got the keyboard and mouse interfaces down, all nice and oopy, and I've (with the help of my friend and co-coder) swigged an interface to FMOD (couldn't find any for Python 2.3), and that works perfectly too (it's not all tested, only mostly, but so far it works perfectly). Now the last portion of the engine - for the initial release, at least - is the whole graphic shpiel. PyGame is very nice, I hope I'm not offending anyone - but it is, in my experience, a bit slow. OpenGL is fast (the demos seemed promising, I wrote a few quick programs and liked the resulting fps), and I figured I wouldn't mind going through some hoops to get OpenGL's speed into an oo-2d oriented interface. We've thought of using directX, but it doesn't have any real glu/glut equivalents and we would lose portability, which was part of the whole point in the first place. So anyone have any suggestions? We're really stumped, I figured writing the graphic routines would be the easy part, and instead it's threatning to kill the project :( Amos |
From: Mike C. F. <mcf...@ro...> - 2004-04-26 06:24:41
|
sn...@so... wrote: > > Hi, I am writing a simple demo in python using pyOpenGL, and > encountered some difficulties: I didn't realize openGL was so > completely 3D oriented, there are no bitmap-drawing functions, not > even a circle drawing one that I could find. > I don't actually need much, would it be practical to write a bitmap > drawing function in openGL? I've been trying, but am a bit lost (just > a bit). > If it isn't, does anyone know of any alternatives? (Portability is > important) > Amos If this is really the limit of your interest, OpenGL is probably way too big a hammer to pull out. Something like PyGame would likely be far easier to work with, as it has all the device-context-style drawing facilities most bitmap-oriented development would need. BTW, pyopengl-users-admin is the administrative account, you likely wanted to send the query to pyopengl-users (copied on this message). Have fun, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Reto S. <rsp...@no...> - 2004-04-15 09:15:09
|
Hello, Im actually writing some stuff in python (opengl). It should be a game somewhen and is already a bit playable (flying around, collision detection). If anybody is interested you can download it here (no cvs): http://www.nouser.org/content/e219/e282/index_ger.html as it is in development state you have to set a path in one file: pywerse.py linux:: basepath="/home/benutzername/pywerse/" windows: basepath="c:\\Dokumente und Einstellungen\\benutzername\\Desktop\\pywerse\\" debian unstable needs the following packages: python python2.3-pygame and you need to download and compile http://pyopengl.sourceforge.net/ >= 2.0 Grafics are atually taken from Andromeda 9. Unfortunately the development of this project seems to be dead. Please send me feedback if you try it out. If you get it running under windows tell me because i just tried it in an emulator (it starts but made grafic errors). Reto |
From: Robert <ro...@ma...> - 2004-04-15 05:47:14
|
hi, i've looked around the web and at the list for the following problem. i thought a message on the list had solved but after trying out the solution, i still couldn't get it to work. here's my problem: i want to render a simple triangle made of of vertices and indices. i use glEnableClientState(GL_VERTEX_ARRAY), glVertexPointerf( vertices ), glDrawElementsui( surfaces ) but nothing gets drawn. i then wrote a simple loop that would traverse the vertices and surfaces in the order in which i expect (!) glDrawElementsui to work and it works. it draws the simple triangle. below is the code: i'm using PyOpenGl 2.0.0.44 on win32 with Python 2.2 the proposed solution on the mailing list (http://sourceforge.net/mailarchive/message.php?msg_id=4959668) was to disable culling. apparently, the guy was specifying indices in a clockwise manner so he wasn't seeing his polys because they were facing away, but you'll see that mine is CCW. this bit of code will display a window and let you spin, rotate, and zoom the "scene". if you uncomment the lines after glDrawElementsui you'll see the small triangle i'm trying to render on the bottom of the screen. use the right mouse button to spin it up or down. i'm new to OpenGL so i might well have made a dork mistake. if so, i apologize for taking up your time but i'll be thankful for the solution. /r import sys, time, os from Numeric import * from math import * import Image from OpenGL.GL import * from OpenGL.GLE import * from OpenGL.GLUT import * from OpenGL.GLU import * #from lwo2daruma import * class ObjectViewer: def __init__ (self): self.width = 640 self.height = 480 self.mouseX = 0 self.mouseY = 0 self.twistAngle = -45. self.tiltAngle = -70. self.distance = 200. self.LeftMouseButtonDown = False self.RightMouseButtonDown = 0 self.scale = 1. glutInit([]) glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ) glutInitWindowSize(self.width, self.height) glutCreateWindow("Object Viewer") glutDisplayFunc(self.OnDisplay) glutMotionFunc(self.OnMotion) glutIdleFunc(self.OnIdle) glutReshapeFunc(self.OnReshape) glutMotionFunc(self.OnMotion) glutMouseFunc(self.OnMouseFunc) glutPassiveMotionFunc(self.OnMotion) glutMainLoop() def OnMouseFunc(self, button, state, x, y): y = self.height - y - 1 if button == GLUT_LEFT_BUTTON: self.LeftMouseButtonDown = state == GLUT_DOWN if button == GLUT_RIGHT_BUTTON: self.RightMouseButtonDown = state == GLUT_DOWN self.mouseX = x self.mouseY = y def OnMotion(self, x, y): y = self.height - y - 1 # if mouseButtonDown: if self.LeftMouseButtonDown: self.twistAngle += x - self.mouseX self.tiltAngle -= y - self.mouseY # if right mouse button down if self.RightMouseButtonDown: self.distance -= (y-self.mouseY)/3. if self.distance < 0.: self.distance = 0. self.mouseX = x self.mouseY = y def OnReshape (self, width, height): glViewport(0,0,width,height) self.width = width self.height = height def OnIdle (self): glutPostRedisplay() def OnDisplay (self): glClearColor(0., 0., .3, 0.) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45., self.width / self.height, self.scale*50., self.scale*1000.) glMatrixMode(GL_MODELVIEW) glLoadIdentity() # translate viewpoint glTranslatef(0., 0., -self.distance * self.scale) glRotatef(self.tiltAngle, 1., 0., 0.) glRotatef(self.twistAngle, 0., 0., 1.) glTranslatef(0., 0., -90. * self.scale) self.renderObjects() glutSwapBuffers() def renderObjects (self): #glDisable(GL_LIGHTING) #glDisable(GL_CULL_FACE) glEnable(GL_DEPTH_TEST) glShadeModel(GL_SMOOTH) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) # test with wireframe glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) vertices = array([ [0.,0.,0.], [10.,0.,0.], [0.,10.,0.] ], 'f') surfaces = array( [ 0, 1, 2 ], 'i') glColor4f(1., 1., 1., 1.) glVertexPointerf(vertices) glEnableClientState(GL_VERTEX_ARRAY) glDrawElementsui(GL_TRIANGLES, surfaces) # this works =( # comment out """ below and you'll see the triangle down towards the bottom # of the screen """ glBegin(GL_TRIANGLES) for i in range(len(surfaces)/3): for j in range(3): glVertex3f( vertices[surfaces[i*3+j]][0], vertices[surfaces[i*3+j]][1], vertices[surfaces[i*3+j]][2]) glEnd() #""" glDisableClientState(GL_VERTEX_ARRAY) glDisable(GL_LIGHTING) glDisable(GL_LIGHT0) glDisable(GL_DEPTH_TEST) if __name__ == '__main__': ObjectViewer() |
From: Mike C. F. <mcf...@ro...> - 2004-04-12 19:30:57
|
Don't have time to do much testing, but here are some ideas: * glutIgnoreKeyRepeat -- use this, then use a timer/polling solution so that what you get are the down event, then while the key is down you issue the equivalent of a repeat every X milliseconds (glutTimerFunc), and you stop when you get the up event. To do this, you need to track the currently-down keys yourself and remove them from your tracking table when the up-event comes in. * Use PyGame as your GUI library and it's (game-oriented) mechanisms for polling current keyboard state (e.g. pygame.key.get_pressed() with the same basic event+timer mechanism as for GLUT. The advantage here being that PyGame does all the tracking of currently-down keys for you. HTH, Mike Snails wrote: > Hello all. > I'm writing a simple pong game in python, using pyOpenGL of course. > I've got most of it down, but when I used glutKeyboardFunc > <http://pyopengl.sourceforge.net/documentation/manual/glutKeyboardFunc.3GLUT.html> to > capture input from the keyboard, I encountered a problem: when a key > is pressed and not released, instead of being called continuously > (good), my callback function is called once, then there's a small > delay, and only then is it called continuously (bad). I'm not > especially knowledgeable about how the keyboard works, but this is > obviously the same behavior as in a text box, when you press any key, > it delays a bit after the initial press before generating more > keypresses. ... > Portability is rather important, but if there's no single module I can > use to read (what do you call this type of keyboard input anyway?) the > keyboard in the desired way, a platform-specific solution would be > helpful also, and the best would be one from within PyOpenGL itself. ... _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Snails <sn...@so...> - 2004-04-12 19:05:49
|
Hello all. I'm writing a simple pong game in python, using pyOpenGL of course. I've = got most of it down, but when I used glutKeyboardFunc to capture input = from the keyboard, I encountered a problem: when a key is pressed and = not released, instead of being called continuously (good), my callback = function is called once, then there's a small delay, and only then is it = called continuously (bad). I'm not especially knowledgeable about how = the keyboard works, but this is obviously the same behavior as in a text = box, when you press any key, it delays a bit after the initial press = before generating more keypresses. I've looked in the OpenGL and GLU reference, but none of them seem to = have any functions that deal with keyboard input. GLUT doesn't seem to = have any alternate way of checking keypresses, as in SDL, where you can = check if a key is being pressed NOW, or stack up all key presses so that = you can deal with them one at a time. Is there any way to solve this from within OpenGL? Assuming that the = answer to that is NO, I'm not exactly sure how to approach this problem: = I've tried doing it through the various modules that come with python, = no success there (not even a good lead). I've also tried finding other = libraries or modules to do this with. It occurred to me that I could use = SDL only for this part of my game, but I don't especially like the idea = of importing all of it for only this small part that I can't seem to get = around. Portability is rather important, but if there's no single module I can = use to read (what do you call this type of keyboard input anyway?) the = keyboard in the desired way, a platform-specific solution would be = helpful also, and the best would be one from within PyOpenGL itself.=20 Oh, and I've searched google for it for lengthy periods of time, and = even found a thread about a guy who was making.. a pong game! Sadly, no = one seems to have encountered this problem - or maybe they were not = bothered by it - or maybe the solution is really obvious - or maybe this = is all one giant hallucination (God is teasing me again). Either way, = help would by appreciated. Amos |
From: Mike C. F. <mcf...@ro...> - 2004-04-09 17:15:15
|
This is a known bug that has been fixed in CVS. See thread in pyopengl-users from around March 12th or so titled "problems with glMap1f in pyopengl2". Building from the 2.0.1 CVS maintenance branch should solve the problem. Good luck, Mike Rich Drewes wrote: >The 2D (surface) NURBS demos seem to work OK, but when I try to code a >simple line BSPLINE based on C demos I've found, this section of code: > >ctrlpoints=[[-4.0, -4.0, 0.0], [-2.0, 4.0, 0.0], [2.0, -4.0, 0.0], [4.0, 4.0, 0.0]] >glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, ctrlpoints) # no stride or order in pygl > > > ... >Searching the archive, I notice somebody asked about getting a BSPLINE >type line working a while back. The answer he got was that the 2D demos >work . . . true enough, but maybe there is something else going on. > > ... _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Rich D. <dr...@in...> - 2004-04-09 15:45:28
|
The 2D (surface) NURBS demos seem to work OK, but when I try to code a simple line BSPLINE based on C demos I've found, this section of code: ctrlpoints=[[-4.0, -4.0, 0.0], [-2.0, 4.0, 0.0], [2.0, -4.0, 0.0], [4.0, 4.0, 0.0]] glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, ctrlpoints) # no stride or order in pygl seems to fail with this error: Traceback (most recent call last): File "./netplot.py", line 158, in on_display self.drawsyn() File "./netplot.py", line 72, in drawsyn glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, ctrlpoints) # no stride or order in pygl OpenGL.GL.GLerror: [Errno 1281] invalid value Since the docs weren't clear on how to format ctrlpoints as far as I could find, I have also tried changing the format of ctrlpoints to this: ctrlpoints=[-4.0, -4.0, 0.0, -2.0, 4.0, 0.0, 2.0, -4.0, 0.0, 4.0, 4.0, 0.0] I think the answer lies with ctrlpoints but I'm at a loss for now. Any ideas? Searching the archive, I notice somebody asked about getting a BSPLINE type line working a while back. The answer he got was that the 2D demos work . . . true enough, but maybe there is something else going on. Thanks, Rich |
From: John F M. Jr <jo...@jo...> - 2004-04-02 20:04:45
|
The problem with PyOpenGL with py2exe is that it looks for the Version file when it starts up. What I did was change one of the startup files that tries to load "version", and wrap it with a try:except: so that if it can't open the file it will just use a default version number. The other issue that you can run into is that the PyOpenGL binary depends on numarray. I don't know that it works with numarray, I think it only works with Numeric (numpy). But you still must have it installed. And with py2exe, you must also include the numarray .pyd files. numarray dynamically loads the files, so py2exe is not able to tell statically which files it depends on. Here is my workaround: def numarray_imports(): """Num array doesn't report it's dependencies properly because it does dynamic importing using exec('import *') instead of static importing. But that's okay, this works around that problem """ numarray_types = ('Bool', 'Complex32', 'Complex64', 'Float32', 'Float64' , 'Int16', 'Int32', 'Int64', 'Int8', 'UInt16', 'UInt32', 'UInt8') #These are the basic ones numarray_includes = ['numarray', 'numarray.libnumarray', 'numarray._ufunc'] for t in numarray_types: numarray_includes.append('numarray._ufunc' + t) return numarray_includes setup( options = { 'py2exe': { 'compressed':1 , 'optimize':2 , 'includes':numarray_imports() , 'dll_excludes':['OPENGL32.dll', 'DDRAW.dll', 'GLU32.dll'] , 'dist_dir':',dist' } , 'build': { 'build_base':',build' } } , data_files = [('images', images), ('lib', msvc_dlls())] , zipfile = 'lib/sharedlib' , windows = [pulmon] , cmdclass = {'py2exe':build_installer} ) By the way, it would be nice if the PyOpenGL script didn't require the version file by default. The script at fault is OpenGL/__init__.py. These are the lines at fault: filename = os.path.join(os.path.dirname(__file__), 'version') __version__ = string.strip(open(filename).read()) __build__ = int(string.split(__version__, '.')[3]) And this is my workaround: filename = os.path.join(os.path.dirname(__file__), 'version') try: __version__ = string.strip(open(filename).read()) except IOError: __version__ = "2.0.1.07" __build__ = int(string.split(__version__, '.')[3]) John =:-> |
From: Robert C. <ro...@fa...> - 2004-04-01 06:46:42
|
hi, i just started using pyopengl to work along with cal3d. running a model viewer that i wrote works fine if i run it in the interpreter by doing something like this: python myscript.py but once i try to make a standalone executable using py2exe the program crashes with an access violation when i call glDrawElementsui. this call works fine, however, in the interpreter. i followed the steps for using py2exe as documented on the pyopengl project website so i went ahead and wrote a program to embed the python interpreter to see if py2exe was the problem. it appears that it is because the script runs fine inside my program. here's some info: pyopengl version: PyOpenGL-2.0.0.44.win32-py2.2.exe os: win xp pro compiler: ms vc++ 6 (for embedding the interpreter to test against py2exe) has anyone run into this? if you need more info please ask. i'd rather use py2exe than embedding the interpreter myself. any help is appreciated. /r |
From: Mike C. F. <mcf...@ro...> - 2004-03-30 03:03:52
|
Sure, append to the children... t.children.append( someShape ) HTH, Mike brett hartshorn wrote: >Hi Mike, > >Is there a way to build the scenegraph *hierarchy* in a cleaner way? >Your example has some crazy indentation going on. It would be nice to have it more DOM like, ie: >node.appendChild(child) > >thanks, >-brett > > _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: brett h. <bha...@ya...> - 2004-03-30 01:22:10
|
Hi Mike, Is there a way to build the scenegraph *hierarchy* in a cleaner way? Your example has some crazy indentation going on. It would be nice to have it more DOM like, ie: node.appendChild(child) thanks, -brett --- "Mike C. Fletcher" <mcf...@ro...> wrote: > Samples using scenegraphs (directly instantiated, not loading from a file): > glelathe.py > indexedfaceset_lit_npf.py > indexedfaceset_lit_npv.py > mouseover.py > particles_simple.py > point_and_click.py > selectrendermode.py > simplerotate.py > wx_with_controls.py > > Most of the tests are actually using scenegraph nodes, they just don't > use the actual scenegraph *hierarchy*, as they are testing lower-level > functionality. OpenGLContext is strongly OO, it's not like VPython > where you create "script" modules. You get things done by sub-classing > the BaseContext (which is a class, not an instantiation of a class), > then overriding methods such as OnInit and getSceneGraph. > > Here's your expectation translated: > > #! /usr/bin/env python > from OpenGLContext import testingcontext > BaseContext, MainFunction = testingcontext.getInteractive() > from OpenGLContext.scenegraph.basenodes import * > > scene = sceneGraph( > children = [ > Group( > DEF = 'g', > children = [ > Transform( > DEF = 't', > translation = ( 1,2,3 ), > children = [ > Shape( > geometry = Box(), > # follows VRML97 standard, so normally > # want the material Node so that there > # will be lighting applied... > appearance=Appearance( > material = Material(), > ), > ), > ], > ), > ], > ), > ], > ) > class TestContext( BaseContext ): > def OnInit( self ): > self.sg = scene > def getSceneGraph( self ): > return self.sg > > if __name__ == "__main__": > MainFunction ( TestContext) > > I'll look at adding this kind of stuff to this page when I get a chance: > http://pyopengl.sourceforge.net/context/vrml97.html > since it's likely the "right" place for it. > > HTH, > Mike > > brett hartshorn wrote: > > >Hi, > > > >I could not find any examples using the scene graph nodes in openglcontext 2.0. All of the > >examples found in tests/ seem to only show how to use direct opengl calls. None of the > examples i > >looked at showed how to work with the scene graph nodes. > > > >How do i do something simple like: create a new group, transform, and model, and then render > it? > >I am expecting it would work something like... > > > >from OpenGLContext.scenegraph.basenodes import * > >BaseContext, MainFunction = testingcontext.getInteractive() > > > >g = Group() > >t = Transform() > >geo = Box() > > > >t.tranform(1,2,3) > > > >g.addChildren(t) > >t.addChildren(geo) > > > >viewer = BaseContext > >viewer.setSceneGraphData(g) > >MainFunction(viewer) > > > > > >-brett > > > > > _______________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://members.rogers.com/mcfletch/ > > __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html |
From: Mike C. F. <mcf...@ro...> - 2004-03-29 22:07:52
|
Samples using scenegraphs (directly instantiated, not loading from a file): glelathe.py indexedfaceset_lit_npf.py indexedfaceset_lit_npv.py mouseover.py particles_simple.py point_and_click.py selectrendermode.py simplerotate.py wx_with_controls.py Most of the tests are actually using scenegraph nodes, they just don't use the actual scenegraph *hierarchy*, as they are testing lower-level functionality. OpenGLContext is strongly OO, it's not like VPython where you create "script" modules. You get things done by sub-classing the BaseContext (which is a class, not an instantiation of a class), then overriding methods such as OnInit and getSceneGraph. Here's your expectation translated: #! /usr/bin/env python from OpenGLContext import testingcontext BaseContext, MainFunction = testingcontext.getInteractive() from OpenGLContext.scenegraph.basenodes import * scene = sceneGraph( children = [ Group( DEF = 'g', children = [ Transform( DEF = 't', translation = ( 1,2,3 ), children = [ Shape( geometry = Box(), # follows VRML97 standard, so normally # want the material Node so that there # will be lighting applied... appearance=Appearance( material = Material(), ), ), ], ), ], ), ], ) class TestContext( BaseContext ): def OnInit( self ): self.sg = scene def getSceneGraph( self ): return self.sg if __name__ == "__main__": MainFunction ( TestContext) I'll look at adding this kind of stuff to this page when I get a chance: http://pyopengl.sourceforge.net/context/vrml97.html since it's likely the "right" place for it. HTH, Mike brett hartshorn wrote: >Hi, > >I could not find any examples using the scene graph nodes in openglcontext 2.0. All of the >examples found in tests/ seem to only show how to use direct opengl calls. None of the examples i >looked at showed how to work with the scene graph nodes. > >How do i do something simple like: create a new group, transform, and model, and then render it? >I am expecting it would work something like... > >from OpenGLContext.scenegraph.basenodes import * >BaseContext, MainFunction = testingcontext.getInteractive() > >g = Group() >t = Transform() >geo = Box() > >t.tranform(1,2,3) > >g.addChildren(t) >t.addChildren(geo) > >viewer = BaseContext >viewer.setSceneGraphData(g) >MainFunction(viewer) > > >-brett > > _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: brett h. <bha...@ya...> - 2004-03-29 19:55:28
|
Hi, I could not find any examples using the scene graph nodes in openglcontext 2.0. All of the examples found in tests/ seem to only show how to use direct opengl calls. None of the examples i looked at showed how to work with the scene graph nodes. How do i do something simple like: create a new group, transform, and model, and then render it? I am expecting it would work something like... from OpenGLContext.scenegraph.basenodes import * BaseContext, MainFunction = testingcontext.getInteractive() g = Group() t = Transform() geo = Box() t.tranform(1,2,3) g.addChildren(t) t.addChildren(geo) viewer = BaseContext viewer.setSceneGraphData(g) MainFunction(viewer) -brett __________________________________ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html |
From: Mike C. F. <mcf...@ro...> - 2004-03-28 15:10:00
|
Most of the scripts in the Demo sub-directories are written with Togl. This may change with the 2.1 release, but it's true for the 2.0.1 releases. The Togl-based demos will likely be moved to their own directory for historic reference when that happens btw. Have fun, Mike Levi VanOort wrote: > I have searched high and low for an example of using PyOpenGL with > Tkinter and have been unsuccessful in finding one. If anyone can > point to a good code example or maybe even give me some tips about > getting started using the Togl widget I would really appreciate it. > I've seen and used Pygame and Glut but really need to be able to embed > OpenGL into a Tkinter script. > > Levi VanOort > lva...@ho... _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Gary H. <gh...@is...> - 2004-03-27 08:37:43
|
On Friday 26 March 2004 09:23 pm, Levi VanOort wrote: > I have searched high and low for an example of using PyOpenGL with > Tkinter and have been unsuccessful in finding one. If anyone can point > to a good code example or maybe even give me some tips about getting > started using the Togl widget I would really appreciate it. I've seen > and used Pygame and Glut but really need to be able to embed OpenGL into > a Tkinter script. > > Levi VanOort > lva...@ho... The package that does this is Togl. I assume you can search on that and find what you want. Gary Herron |
From: Levi V. <lva...@ho...> - 2004-03-27 05:23:12
|
I have searched high and low for an example of using PyOpenGL with Tkinter and have been unsuccessful in finding one. If anyone can point to a good code example or maybe even give me some tips about getting started using the Togl widget I would really appreciate it. I've seen and used Pygame and Glut but really need to be able to embed OpenGL into a Tkinter script. Levi VanOort lva...@ho... |
From: <fl...@go...> - 2004-03-22 05:25:05
|
I've been having trouble getting some code that I wrote converted to using glVertexPointer... I even wrote some test code that errors on mine... # assuming i've already bound a texture glEnable(GL_TEXTURE_2D) glEnableClientState(GL_TEXTURE_COORD_ARRAY) vta_vt = [(0,0,0),(1,0,0),(0,1,0)] vta_tx = [(0,0),(1,0),(0,1)] glVertexPointerd(vta_vt) #glTexCoordPointerd(vta_tx) glTexCoordPointer(2,GL_DOUBLE,0,vta_tx) glEnableClientState(GL_VERTEX_ARRAY) glEnableClientState(GL_TEXTURE_COORD_ARRAY) glDisableClientState(GL_COLOR_ARRAY) glDrawArrays(GL_TRIANGLES,0,3) glDisableClientState(GL_TEXTURE_ARRAY) Could someone please tell me what I'm missing or why it doesn't work? (I've tried it on several machines and it fails on all of them) Traceback (most recent call last): File "C:\WINDOWS\Desktop\mpp\misc_pygame_projects\Render Framework Test\simple_poly_model.py", line 1101, in rend_tex_mul glTexCoordPointer(2,GL_DOUBLE,0,vta_tx) GLerror: [Errno 1282] invalid operation |