Index: [thread] [date] [subject] [author]
  From: becka@rz.uni-duesseldorf.de
  To  : ggi-develop@eskimo.com
  Date: Thu, 19 Aug 1999 18:23:50 +0200 (MET DST)

Re: circle,dotted line

> any urls to algorithms drawing shaped lines
> and circles ?

Hmm - aren't they implemented in LibGGi2D ?

Dotted stuff is usually done like this

while(not done) {

	rotl(mask);	/* rotate left. like mask=(mask<<1)+(mask>>31); */
	if (pattern&mask) really_draw();
}

For circles there are several different algorithms. The most common one is 
probably a squared bresenham variant, but that is pretty complex to
understand. For simple stuff I'd resort to calculate a bunch of points
on the border (like every 5 degrees or so) and draw lines in between.

CU, ANdy

-- 
Andreas Beck              |  Email :  <Andreas.Beck@ggi-project.org>


Index: [thread] [date] [subject] [author]