[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Lousy FPS



On 9/12/06, Kris Schnee <kschnee@xxxxxxxxxx> wrote:
[SW approach drawing tiles every frame to get object occlusion right]

well if you are going to get a nice speed with SW rendering, the trick
is to do as little as possible. I think drawing from pre-composited
backgrounds would be the least you can do when scrolling. I think the
object occlusion thing can be handled with a dirty rect system, where
you first draw from your pre-composed surface(s) (without alpha
blending or color-keying for speed), and then draw the whole thing
back to front interleaving objects and tiles properly sorted, where
the objects cause screen areas to be dirty and tiles only draw to the
dirty rects. The only ugly part is you'd get aliased edges on your
tiles to double draw if you have them.

Or if you want pygame/SDL rendering but are cool with HW acceleration,
you could try going with that...

...but I'd probably go with OpenGL myself

[Isometric opengl stuff]

I think what you are looking for is an "Orthographic" projection
(that's ortho as in orthogonal, meaning perpendicular, indicating that
your z axis is drawn straight back, and doesn't go to a vanshing point
like perspective)

there's a gl function called glOrtho that you can use to set up your
projection matrix, combined with a model matrix for a rotation (so you
look at the world at an angle) you should be able to get your
isometric look