Hi Luis, On Mon, 2010-08-02 at 17:51 +0000, Luis navarro del angel wrote: > Hi Gabor, > > Thanks a lot for the corrections in the spiral code, it looks great!! > > I have another question, when I use the pdata-map! I only can make > work the array type "p" by putting (rndvec). Otherwise if I put only > numbers in the vector it doesn't do anything. I think I'm missing > something about the pdata, I already read the pdata and the > deformation part of the manual, but I can't get it at all. > > I also understand that using pdata-set! we can access to a determined > vertex, but if we use pdata-map! all the vertices are going to be > modified, am I right??
That is correct. > For example, if in this code I replace the "(rndvec)" for a "(vector 1 > 3 0)", nothing happens: > > (clear) > > (define s (build-sphere 10 10)) > > (with-primitive s > (pdata-map! > (lambda (p) > (rndvec)) > "p")) Well, what's happening when you use (vector 1 3 0) is that all the vertices are collapsing onto that one point, so there is nothing visible. If you try using (vadd p (vector 1 3 0)) the sphere should move by that amount, as it's being added to all the vertices - which is maybe what you were expecting... cheers, dave > > Thanks, > > Luis
