POV-Ray : Newsgroups : povray.programming : POV-Ray v.4 proposal : Re: POV-Ray v.4 proposal Server Time
29 Jul 2024 04:22:01 EDT (-0400)
  Re: POV-Ray v.4 proposal  
From: Margus Ramst
Date: 18 May 1999 12:02:30
Message: <37418106.0@news.povray.org>
This would be trivial to implement with macros. Especially when (if) the
Superpatch's #ifdef(Array[Elem]) function makes it into the official
version. Until then the size of the array would need to be specified.
For example, array rotate:

#macro ARot(Array,ArraySize,RotVect)
    #local C=0;
    #local NewArray=array[ArraySize]
    #while(C<ArraySize)
        #local NewArray[C]=vrotate(Array[C],RotVect);
        #local C=C+1;
   #end
   NewArray
#end

#declare Array1=array[N]{...}
#declare Array2=ARot(Array1,N,<XRot,YRot,ZRot>)

Margus

J. Grimbert wrote in message <3740210A.4E1BDC0E@atos-group.com>...
>
>What is needed is probably more something like array operator.
>After all, pov have :
> rotate and translate for objects
> vrotate and + for vectors
>
>We may probably get a nice enhancement with something like
> arotate and atranslate for array of vector
>
>#declare new_array = arotate(old_array, B );
>
>and
>#declare new_array = atranslate(old_array, B);
>
>BTW, we could also need some scaling:
>#declare new_array = ascale(old_array, B);
>


Post a reply to this message

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