Re: A86: Drawing circles
[Prev][Next][Index][Thread]
Re: A86: Drawing circles
Butler Family wrote:
>
> Grams Family wrote:
>
> At 09:14 AM 11/3/97 -0500, you wrote:
> >On Sun, 2 Nov 1997, MrManson wrote:
> >
> >> Robby Gutmann wrote:
> >> >
> >> > Is there an easier way to draw circles than using
> sprites? if not,
> >>
> >> yeah use sine and cosine, gonna have to manipulate the
> values in the OPs
> >
> >Don't use sine and cos functions to draw circles. It's
> slow, and not well
> >suited to a bitmapped display. Do a net search for
> "Bresenham" and
> >"circle" and you will find lots of info on drawing circles
> on bitmapped
> >displays.
> >
> As I recall, the Bresenham circle algorithm uses some
> multiplication, so it
> might be a pain to write. _Definitely_ worth it though. If
> you do it right,
> it can do ellipses too.
>
> --Joshua
>
> here is a QuickBasic version of it sorry i am too lazy to write the
> ASM version i think almost everything can be multiplied using the sll
> thing i think
>
> ;RADIUS=r
> ;centr of circle=(cx,cy)
> ;
>
> Cldrw
> 0×x
> (radius)×y
> 3-(2*r)×d
> While x÷Y
> PtOn(xc+x,yc+y)
> PtOn(xc+x,yc-y) ;you might want to put this all on one line for fun
> using colon
> PtOn(xc-x,yc+y)
> PtOn(xc-x,yc-y)
> PtOn(yc+y,xc+x)
> PtOn(yc+y,xc-x)
> PtOn(yc-y,xc+x)
> PtOn(yc-y,xc-x)
> If d<0
> Then
> d+4*x+6×d
> Else
> d+4*(x-y)+10×d
> End
> x+1×x
> End
you forgot to add the 'declaration' of xc and yc
Follow-Ups:
References: