fixes, more trig, demo with floats
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
(
|
||||
; mouse over the image to draw circles
|
||||
(sc-init 800 600)
|
||||
(sc-opt SCREEN_AUTO_BLIT 0)
|
||||
|
||||
(:loop)
|
||||
(sc-poll)
|
||||
(sc-mouse r4 r5 (ov? (j :loop)))
|
||||
(itf r4)
|
||||
(itf r5)
|
||||
|
||||
(ld r0 0.0)
|
||||
(def RADIUS 50.0)
|
||||
(:circle)
|
||||
(fsin r1 r0)
|
||||
(fcos r2 r0)
|
||||
|
||||
(fmul r1 RADIUS)
|
||||
(fmul r2 RADIUS)
|
||||
|
||||
(fadd r1 r4)
|
||||
(fadd r2 r5)
|
||||
|
||||
(fti r1)
|
||||
(fti r2)
|
||||
(sc-px r1 r2 #66ff00)
|
||||
(fadd r0 0.1) ; make lower for a smoother circle
|
||||
(fcmp r0 TAU
|
||||
(ge?
|
||||
(sc-blit)
|
||||
(j :loop)))
|
||||
(j :circle)
|
||||
(j :loop)
|
||||
)
|
||||
Reference in New Issue
Block a user