|
![](/i/fill.gif) |
pare03 nous apporta ses lumieres en ce 2005-09-26 11:43:
> Hi,
>
> I'm a new user and I'm trying to create macros for the creation of some
> solid primitives. And I was wondering how to create a SOR_Creation macro
> that would create an SOR.
>
> A very simple macro would look like that:
>
> #macro SurfaceOfRevolution_Creation(VectorOfPoints, NbOfPoints, Texture)
>
> sor {NbOfPoints,VectorOfPoints texture { Texture }}
>
> #end
>
> The problem is that the sor function expects vectors, and not an array of
> vectors. My questions is - What's the easiest and simplest way to extract
> the vectors of an array and make functions like sor work ?
>
> Thank you very much,
> David.
>
>
You need to use a loop to get each vertor. A code like:
sor{NbOfPoints,
#local Index = 0;
#while(Index < NbOfPoints - 1)
VectorOfPoints[Index],
#local Index = Index + 1;
#end
VectorOfPoints[Index] // No comma for last point
texture{Texture}
}
--
Alain
-------------------------------------------------
Quakers: Let us not fight over this shit.
Post a reply to this message
|
![](/i/fill.gif) |