Hello,
my name is Pablo and I'm writing from Argentina. Right now I'm
coding a little application for some course I'm doing.
The course is on Computer Graphics. We were asked to write algorithms to
draw line segments and polygons, and to create the structure that is
necessary to achieve scenes, with transformations. I know this probably
won't make much sense to you, but we were asked to use wxWidgets.
Since I always liked Python, I said I'd like to do it using Python
instead of C++, and that was ok to them. So we used wxPython.
Thing is that right now we've showed the professor our first version. He
liked it, and he asked us to make some changes and add a few features.
In this program, I'm doing animations. Basically, I have a wx.Timer that
draws the new frame each time. To achieve better performance, I write
the pixels into a PIL Image, then convert it to a bitmap, and then show
it using wx.PaintDC's DrawBitmap() method.
I think I'm pushing the timer to its limits (I'm using 1 as the
parameter to Start()) and the animation is a little slow. I'm wondering
whether I could make the performance a little better.
Is there a faster way to create/show a bitmap?
Please, understand that we're not allowed to use things like DrawLine();
we're supposed to implement our own line drawing functions. We can only
use functions to write pixels into a bitmap, or a DrawPoint() function.
You can see the project here: http://code.google.com/p/cg-pm-2009/
Any help will be greatly appreciated.
···
--
Pablo Antonio (AKA crazy2k)
http://www.pablo-a.com.ar/