PDA

View Full Version : Implementing Bresenham's algorithm



hkm
02-12-2004, 09:49 AM
Hi,
I m new to OpenGL. I've to write a program that draw polygons implementing Bresenham's algorithm. Can anyone pls share some ideas on getting started? Thanks in advance.

dorbie
02-12-2004, 11:02 AM
This is not an OpenGL question.

OpenGL draws lines using it's own internal algorithm.

Bresenham's algorithm is a software line drawing algorithm that would be used by a program that does it's own software rendering instead of OpenGL. In addition it would draw only the polygon edges at best.

To implement what you're talking about using OpenGL you would do software line drawing and then a gldrawpixels to display the image, but OpenGL would be incidental to the task.

Please at least search online for information on this topic, it is probably one of the most common pieces of graphics code available and is in every basic text book on graphics.