POV-Ray : Newsgroups : povray.newusers : Using arrays of vectors : Re: Using arrays of vectors Server Time
29 Jul 2024 14:25:10 EDT (-0400)
  Re: Using arrays of vectors  
From: Alain
Date: 26 Sep 2005 18:06:13
Message: <433870d5$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.