[Fluxus] Pdata-index-map!

Kassen signal.automatique at gmail.com
Tue Oct 19 15:36:54 PDT 2010


Hey Luis,

>
> I have another question, when you say that the "pdata-index-map! supplies
> the current pdata index number to the procedure", do you refer that I am
> giving a name to the current pdata?
>
>
Well, no. What pdata-index-map! does is iterate over the pdata like
pdata-map! does (that means; it goes over all vertices in turn) and in
addition to the reference to the vector in question you also get the "index"
of that vector, being a integer between 0 and (pdata-size).

This is useful because when you know you are dealing with a list of
triangles, for example, you will know that indexes 0, 1 and 2 refer to the
corners of one polygon and 3, 4 and 5 refer to another but there is no
polygon using indexes 1, 2 and 3. In the case of a quad-list you'd likely
treat the indexes differently.

Within the function you apply to to these vertices you may use any name you
like as a local variable.

The example you give doesn't actually use the "index" part of
"pdata-inex-map!", but with these notes the example you get when you type
(help pdata-index-map!) might make more sense.

Hope that helps,
Kas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20101020/bea74a27/attachment.html>


More information about the Fluxus mailing list