hi,

I am wondering how to 'slow down' during a loop.
i assume you want to slow down the pattern generation not the rotation. there are many ways probably, the first that came into my mind checks how much time is passed and if it's bigger then a threshold it sets the random seed and increases the threshold.

best,
gabor

----

(define s (time))
(define ds 0.001)
(define seed 0)

(define (cloud num)
    (cond
        ((not (zero? num))
            (draw-sphere)
            (translate (vector 0 (* 2 (grndf)) (* 2 (grndf))))
(colour (vector (* (sin (time)) (/ num 100)) (/ num 100) num))
            (cloud (- num 1)))))

(define (rotate-cloud)
    (when (> (- (time) s) ds)
        (set! s (time))
        (set! seed (+ seed 1))
        (set! ds (* 1.1 ds)))
    (random-seed seed)

    (with-state
        (rotate (vector 0 (* 10 (time)) 0 ))
        (cloud 300)))

(every-frame
    (rotate-cloud))

Reply via email to