Ah great, thanks again for the help! On Wed, Sep 9, 2009 at 5:42 AM, gabor papp <[email protected]> wrote:
> hi Henderson, > > In other news, another simple thing I was playing with from the tutorial >> pdf >> is attached - but I was trying to realise how to make the (gh 1) in the >> pdata deform reset to zero rather than be cumulative? Does it have to be >> > i would not do this to (gh). the attached script works cumulatively because > you reuse the old value of "p" from the previous frame and add a random > number to it. if you always start from the original p value, you can achieve > what you want. > for example: > > (clear) > > (define myob (build-sphere 20 20)) > > (with-primitive myob > ; save original "p" > (pdata-copy "p" "p0")) > > (every-frame > (with-primitive myob > (pdata-map! > (lambda (p p0) > (vadd (vmul (rndvec) (gh 1)) p0)) > "p" "p0"))) > > > i hope this answers your question. > > best, > gabor > >
