<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Gabor</div><div><br></div><div>Thanks for that, but there's still an oddity - there are 3 extra rows?</div><div>This script gives an error because of that - (pdata-size) for the nurbs primitive gives 4288, and (quotient 4288 64) is 67.</div><div>So, the corrected version is below, but this isn't exactly what I'd want - I want to be able to set the number of rows beforehand.  Hmm...</div><div><br></div><div>Cheers</div><div>Evan</div><div><br></div><div><br></div><div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>(clear)<br><br>(define dims 64)<br><br>(define shape<br>    (with-state<br>        (build-nurbs-sphere dims dims)))<br><br>(with-primitive shape<br>    (pdata-copy "p" "p0")<br>    (pdata-copy "n" "n0"))<br><br>(define vals (build-list (with-primitive shape (pdata-size)) (lambda (n) (rndf))))<br><br>(define (bump p)<br>        (with-primitive p<br>                (pdata-index-map!<br>                    (lambda (i p p0 n0)<br>                        (let* ([row (quotient i dims)]<br>                               [rv (list-ref vals row)])<br>                        (vadd p0 (vmul n0 rv))))<br>                    "p" "p0" "n0"))<br>            (recalc-normals 0))<br><br>(every-frame (bump shape))<br><br><br></div></blockquote></div><br></body></html>