[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] getting setup to use PyOpenGL for 2D
> It's really not bad if you write some basic framework for handling your 2D
> stuff. I like to treat it sorta like Pygame's sprite module....I'll have a
> generic class that loads a texture, contains a display list with the quad
> that makes up the object, has X and Y attributes, maybe a zoom attribute,
> etc. It will have something like an update function (or even a seperate draw
> function) that will contain the basic OpenGL rendering code. From there all I
> have to do is call one or two functions of that object every cycle.
> Another tip: for 2D, orthogonal matrices are your friend. :)
Same thoughts here. :) But I've some fear about onscreen coordinates. In
SDL pixel coords are very comfortable. I know OpenGL know this feature
too, but you must set up glViewport() and glOrtho() for this to keep
your sprites size correct.
Orthogonal matrices. Yuck! I had linear algebra two years ago (in the
first semester), but I don't like it much despite of that is heavily
used in computer graphics.
--
DÃme
Home: http://dgyimesi.uw.hu