GLBasic forum

Codesnippets => Code Snippets => Topic started by: Kitty Hello on 2005-Feb-18

Title: Ellipsen
Post by: Kitty Hello on 2005-Feb-18
So zeichnet man schnell gef├╝llte Ellipsen (auch unter PocketPC, wo POLYVECTOR nicht funktioniert).

Code: (glbasic) [Select]
// ------------------------------------------------------------- //
// -=#  ELLPISE  #=-
// ------------------------------------------------------------- //
FUNCTION Ellipse: x, y, w, h, col
LOCAL dy, xi
w=w/2
h=h/2
x=x+w
FOR dy = -h TO h
xi = w/h * SQR(h*h - dy*dy)
DRAWRECT x-xi, y+dy+h, xi+xi, 1, col
NEXT
ENDFUNCTION // ELLIPSE