POV-Ray : Newsgroups : povray.newusers : Using arrays of vectors : Re: Using arrays of vectors Server Time
29 Jul 2024 14:18:21 EDT (-0400)
  Re: Using arrays of vectors  
From: Alain
Date: 28 Sep 2005 18:22:05
Message: <433b178d$1@news.povray.org>
kurtz le pirate nous apporta ses lumieres en ce 2005-09-28 13:33:
> In article <4338e578@news.povray.org>, Warp <war### [at] tagpovrayorg> 
> wrote:
> 
> ::Alain <ele### [at] netscapenet> wrote:
> ::> 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}
> ::> }
> ::
> ::  You don't need the commas at all. Besides, the number of points doesn't
> ::need to be supplied explicitly.
> ::  And by the way, be so kind to not to teach bad habits to beginners by
> ::giving as example badly-indented code.
> 
> comma, no comma... documentation at 
> http://www.povray.org/documentation/view/3.6.1/286/ is a little a 
> ambiguous ! the syntax is :
> SOR:
>     sor
>     {
>         Number_Of_Points, <Point_1>, <Point_2>, ... <Point_n>
>         [ open ] [SOR_MODIFIERS...]
>     }
> SOR_MODIFIER:
>     sturm | OBJECT_MODIFIER
> 
> as you can see, there are comma between <Point_1> and <Point_2> and ...
> 
> but, in a simple vase exemple :
>  #declare Vase = sor {
>   7,
>   <0.000000, 0.000000>
>   <0.118143, 0.000000>
>   <0.620253, 0.540084>
>   <0.210970, 0.827004>
>   <0.194093, 0.962025>
>   <0.286920, 1.000000>
>   <0.468354, 1.033755>
>   open
>  }
> there is NO comma... and as Warp say : no need at all !
> 
> have fun
> klp
So, when using vectors, you don't need commas. But, if you use a simple float as a
shorthand when 
the two coordinates are the same, I think that then you need the commas.

-- 
Alain
-------------------------------------------------
Elevators smell different to midgets


Post a reply to this message

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