[ColorForth] Circle Primitive, happy for response
- Subject: [ColorForth] Circle Primitive, happy for response
- From: "Jimmy Söderman" <hiraganagos@xxxxxxxxxxx>
- Date: Sat, 15 Jun 2002 11:21:10 +0000
- Bcc:
; Grey ColorFORTH source (NOT betatested)
; Circle primitive, meant for 16-bit frambuffers
; Jimmy Söderman
; Any remarks & changes are welcome remeber, it have been total of 50-60
hours pure coding theory hell, no testing whatsoever and im running out of
time now, so i thought ill post it to the public to make the best of it.
And is probably somewhat clumpsy due im not used to ColorFORTH (or FORTH for
that matter), but i tried keep it neat.
and last, SOMELOOP is a word inside CIRCLE, to make a simple loop mechanism.
May the FORTH be with you
*hope it works*
Jimmy.S.
PS. its meant for 800x600 but change the two "1600" into "2400" to make it
work dandy on 1024*768.
; Usage:
; Input : x,y,radius,colorframebuffer.
;Uses 3 integers, and plots 8 points per iteration
CIRCLE variable a variable b variable c variable color variable base color !
dup 2/ - -1 + c ! a ! 0 b ! 1600 * swap 2* + 1e80000 base !
SOMELOOP a @ b @ symmetricplot b @ a @ symmetricplot 1 b +! b @ c +! c @ 0
less - if 1 a -! a @ c -! then a @ b @ less if someloop ; then ;
SYMMETRICPLOT 1600 * swap 2* over over base @ + swap over over + color @ !
-1 * + color @ ! base+xx-yy,color base @ -1 * + swap over over + color @ !
-1 * + color @ !
_________________________________________________________________
Kom med i världens största e-posttjänst med MSN Hotmail.
http://www.hotmail.com
------------------------
To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems - List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site - http://www.colorforth.com