Re: A86: Drawing circles


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

Re: A86: Drawing circles





MrManson wrote:

> 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
> > x=0
> > y=(radius)
> > d=3-(2*r)
> > 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=d+4*x+6
> > Else
> > d=d+4*(x-y)+10
> > End
> > x=x+1
> > End
>
> you forgot to add the 'declaration' of xc and yc

  in Qbasic or almost any basic you dont have declare variables also i think
i fixed it so its readable in normal text its in the original part of the
message.

Patrick


Follow-Ups: References: