[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Lousy FPS
Jan Pobrislo wrote:
Actually, if you want OpenGL version to do isometric rendering, you'll need to
tweak the transformation matrix a bit. I didn't do it for a while, but you
need something like this:
in GL_PROJECTION matrix setup glOrtho view
in GL_MODELVIEW glLoad something like this:
| 1 0 0 0 |
| 0 1 0 0 |
| 0 x 1 0 |
| 0 0 0 1 |
where x is ratio by which Z axis distances (height in world) are translated to
Y axis (up/down on screen), you'll probably use 0.5
you might also be able to use glMultMatrix on GL_PROJECTION instead of glLoad
on GL_MODELVIEW, to have bigger freedom manipulating with modelview matrix
Thanks for the info. I think I may not have explained quite what I
meant, though. What I'm concerned with is the ability to get a
cube-based landscape (as in "Disgaea") to display at a reasonable speed
with decent lighting and the ability to do "picking" (telling which tile
was mouse-clicked). Whether that's technically "isometric" in terms of
the display angle and the manner of perspective distortion doesn't
matter to me; I say "isometric" because I know of the word as "that
thing that some games do with the diagonal camera view." I like that
perspective with tiles and cubes because it allows for terrain with
height, yet is much simpler than true 3D where you have to get 3D
polygon models just to put a bagel onscreen.
I've already got the ability to display a cube-based landscape using
textures and terrain data loaded from a file -- in OpenGL/Pygame or pure
Pygame, using two different homemade engines -- and to tilt and rotate
the OpenGL version. If I'm to use the OpenGL version, I need to figure
out picking, the math involved in making the camera follow the hero's
sprite, something (lighting?) to make the landscape not hideous, and
hopefully something to boost the framerate above 12!
Kris
Kris