Re: [pygame] Dirty Rect Animation

2007-06-08 Thread DR0ID
Hello Yes I do dirty rect animation. If you read the code of the RenderUpdate (in pygame.sprite.Sprite.RenderUpdates) then you will see that this group does something like this: dirty = [ ] if old rect and new rect overlap: dirty_rect = old_rect.union(new_rect) dirty.append(dirty_rec

Re: [pygame] Dirty Rect Animation

2007-06-08 Thread John Cabral
Ahh, thank you both very much. You even answered my follow up question. Best, JC On 6/9/07, Peter Shinners <[EMAIL PROTECTED]> wrote: John Cabral wrote: > I was working on some code for my game and read about the optimization > of feeding a list of rects to the update function. I was curious

Re: [pygame] Dirty Rect Animation

2007-06-08 Thread Peter Shinners
John Cabral wrote: I was working on some code for my game and read about the optimization of feeding a list of rects to the update function. I was curious if it would be worthwhile to try to optimize the list that is fed to the function. Specifically, I would try to shorten the list by merging

Re: [pygame] 3D sample code

2007-06-08 Thread kschnee
On Fri, June 8, 2007 11:29 pm, Richard Jones wrote: > On Sat, 9 Jun 2007, Kamilche wrote: > >> Is there a way to render 3d objects out to disk only, and use the >> renders in a normal Pygame program? Is there any advantage to doing so, >> in speed, or memory, or anything? > > Sure, POV-Ray http://w

Re: [pygame] Dirty Rect Animation

2007-06-08 Thread Patrick Mullen
I'm fairly certain that update does NOT merge incoming rects or do any other optomization on input. It iterates through all of the rects in the list and updates that portion of the screen. So you can optimize it considerably by merging rects where it makes sense, rather than sending a rect for

Re: [pygame] 3D sample code

2007-06-08 Thread Richard Jones
On Sat, 9 Jun 2007, Will McGugan wrote: > Kamilche wrote: > > Is there a way to render 3d objects out to disk only, and use the > > renders in a normal Pygame program? Is there any advantage to doing > > so, in speed, or memory, or anything? > > It is possible to render to a texture and grab that b

Re: [pygame] 3D sample code

2007-06-08 Thread Richard Jones
On Sat, 9 Jun 2007, Kamilche wrote: > Is there a way to render 3d objects out to disk only, and use the > renders in a normal Pygame program? Is there any advantage to doing so, > in speed, or memory, or anything? Sure, POV-Ray http://www.povray.org/ :) There's even pypov http://arrowtheory.com/

Re: [pygame] 3D sample code

2007-06-08 Thread kschnee
On Fri, June 8, 2007 1:09 pm, David wrote: >> You're right that you cant use any of the regular SDL drawing functions >> with OpenGL - or any other accelarated 3D API. You can work with 2D >> graphics in OpenGL though, by drawing texture quads. If you wrap that in >> a simplified interface, then t

Re: [pygame] 3D sample code

2007-06-08 Thread kschnee
On Fri, June 8, 2007 2:30 pm, Kamilche wrote: > Is there a way to render 3d objects out to disk only, and use the > renders in a normal Pygame program? Is there any advantage to doing so, in > speed, or memory, or anything? Take a look at the program at , Peter

[pygame] Dirty Rect Animation

2007-06-08 Thread John Cabral
Hello, all; I was working on some code for my game and read about the optimization of feeding a list of rects to the update function. I was curious if it would be worthwhile to try to optimize the list that is fed to the function. Specifically, I would try to shorten the list by merging rects th

Re: [pygame] Numeric/NumPy/Numarray Clarification

2007-06-08 Thread Lenard Lindstrom
Chris Ashurst wrote: I've been messing around with PyGame and the OpenGL bindings for a while now, and I've recently begun to start seeing the light of using the array classes from numpy for various math operation. The thing is... Does anyone have any sort of clear idea about which package I sho

Re: [pygame] 3D sample code

2007-06-08 Thread Nick Moffitt
Will McGugan: > I think Kamilche was suggesting doing it on the fly. If you were just > going to generate images offline, then you probably wouldnt use > OpenGL. Yes, hence my comment about caching transforms in 2D and how the process might help certain odd cases in 3D. -- "N'aimez pas votre voi

[pygame] mac app stuck on minimized

2007-06-08 Thread sean
Hi Been pulling my hair out over this. On Mac OS X while running my app from the command line the window minimize and click to maximize worked fine. When I packaged it up using py2applet it stopped maximizing when the icon was clicked. Solution: In the setup.py generated by py2app change the a

Re: [pygame] 3D sample code

2007-06-08 Thread Will McGugan
Nick Moffitt wrote: Will McGugan: I don't think it would be pracitcal to render 3D models and blit them in 2D. Happy to be proven wrong though. Well, consider games like powermanga. They generated their sprites using 3-D tools and saved them to disk. I think Kamilche was suggestin

[pygame] Numeric/NumPy/Numarray Clarification

2007-06-08 Thread Chris Ashurst
I've been messing around with PyGame and the OpenGL bindings for a while now, and I've recently begun to start seeing the light of using the array classes from numpy for various math operation. The thing is... Does anyone have any sort of clear idea about which package I should have installed out

Re: [pygame] 3D sample code

2007-06-08 Thread Nick Moffitt
Will McGugan: > I don't think it would be pracitcal to render 3D models and blit them > in 2D. Happy to be proven wrong though. Well, consider games like powermanga. They generated their sprites using 3-D tools and saved them to disk. When I was working on an SDL game in C, I noted that since I

[pygame] pygame network redux, with code!

2007-06-08 Thread Simon Wittber
Based on some discussion re: simple pygame networking, I've whacked together some code. Basically, it allows the server and clients to send marshalable python objects (lists, dicts, numbers, strings etc) between each other. Only documentation is the tests at the moment. The code assumes a dedica

Re: [pygame] 3D sample code

2007-06-08 Thread Will McGugan
Kamilche wrote: Is there a way to render 3d objects out to disk only, and use the renders in a normal Pygame program? Is there any advantage to doing so, in speed, or memory, or anything? It is possible to render to a texture and grab that back, but I don't think you could do that in PyGam

Re: [pygame] 3D sample code

2007-06-08 Thread Kamilche
Will McGugan wrote: [EMAIL PROTECTED] wrote: On Thu, June 7, 2007 2:45 pm, Horst JENS wrote: On Mon, 2007-06-04 at 21:19 +0100, Will McGugan wrote: I've just posted some sample code for using OpenGL with PyGame. Hope you find it interesting. http://www.

Re: [pygame] 3D sample code

2007-06-08 Thread David
You're right that you cant use any of the regular SDL drawing functions with OpenGL - or any other accelarated 3D API. You can work with 2D graphics in OpenGL though, by drawing texture quads. If you wrap that in a simplified interface, then the code doesn't look much different from what you are u