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

Re: [pygame] PyGame / PyOpenGL Example



If you really want to make something nice, even if it is a 2D
background, your best option is to render a 3D image.

The image you're looking at doesn't look like it was created with a
heightmap, the simplest way of making 3D terrain, because the texture
does not appear to stretch.

You can something almost as good by using a heightmap (a heightmap
codes elevations into pixels.  You can use a tool to make them, like
"Earth Sculpter", because doing so by hand is inaccurate and slow).

You then convert the image into a mesh of polygons by iterating
through each pixel.  There some nice tutorials out there for this,
too.  The mesh is then compiled into a display list for speed.  The
map is then drawn at the correct location.  The houses, trees, and the
like in the image you pointed out are made separately, then
superimposed into the final scene before it is drawn.

All in all, it is a pretty complicated mess.  If you're just beginning
OpenGL, I recommend the Python NeHe tutorials:
http://www.pygame.org/gamelets/ as a good introduction.  gamedev.net
can help you with the finer details.

Ian