PDA

View Full Version : Using polygon stippling to draw 8x8 matrix for Conway's Life Game



biterman
09-10-2004, 05:39 AM
Hi,

I'm new to OpenGL, still fresh from console programming in C. And I need to make yet another version of Conway's Game of Life.

I thought it would be a good idea to move on up to a graphic enviroment instead of "drawing" with text in the console, so I naturally thought of OpenGL (and GLUT).

At first I thought I'd draw lots of squares and turn them black or white to represent birth and death, but as I went on reading the Red Book I got to stippling and thought that it might be easier to just change the mask on a polygon. But now I've realize that the mask fits in a polygon many times so changing it doesn't really give me the matrix effect that I need.

Is there a way to make the mask cover the whole width and height of a polygon?

Am I approaching this problem incorrectly? Any suggestions are more than welcome.

Thanks in advance,
biterman.

Relic
09-10-2004, 07:25 AM
Stippling is not that right feature for that.
There are more elegant solutions using the stencil buffer or textures.

Google for "Game of Life OpenGL Stencil"!

For a simple one:
http://www.mmrc.iss.ac.cn/~mli/RedBook/20341.html

An advanced one (Game of Life on that page):
http://download.nvidia.com/developer/SDK/Individual_Samples/samples.html