[Fluxus] nurbs explode FAIL
gabor papp
gabor.lists at mndl.hu
Mon Jan 25 12:16:48 PST 2010
hi evan,
i'm not sure what you are trying to do exactly, but i modified your
script to push out the rows of the nurbs sphere according to the list of
values.
hope it helps,
gabor
(clear)
(define dims 64)
(define shape
(with-state
(build-nurbs-sphere dims dims)))
(with-primitive shape
(pdata-copy "p" "p0")
(pdata-copy "n" "n0"))
(define vals (build-list dims (lambda (n) (rndf))))
(define (bump p)
(with-primitive p
(pdata-index-map!
(lambda (i p p0 n0)
(let* ([row (quotient i dims)]
[rv (list-ref vals row)])
(vadd p0 (vmul n0 rv))))
"p" "p0" "n0"))
(recalc-normals 0))
(every-frame (bump shape))
More information about the Fluxus
mailing list