POV-Ray : Newsgroups : povray.unofficial.patches : name for no interpolation : Re: name for no interpolation Server Time
8 Jul 2024 18:20:45 EDT (-0400)
  Re: name for no interpolation  
From: Christoph Hormann
Date: 11 Sep 2002 09:10:34
Message: <3D7F40C8.C72B329E@gmx.de>
Le Forgeron wrote:
> 
> [...]
> 
> If keyword, instead of positional syntax, had been used, it would be
> far more easier to use the poly object, and p.b.i might be full of them.
> Instead of a long collection of values (with a lot of zero), using
> keyword would have make it easier (*):
> 
>    poly { x6 1 y5 1 z4 1 const -10 }
> 
> If later the user wants to add a x^2yz^3 term, it's also far easier than
> retrieving the correct position in the list:
> 
>    poly { x6 1 y5 1 z4 1 const -10 x2yz3 -3 }
> 

It is fairly possible to program this with macros, think of something
like:

Poly4(1*X6, 1*Y5, 1*Z4, -10*Const)
Poly5(1*X6, 1*Y5, 1*Z4, -10*Const, -3*X2YZ3)

X6, Y5, Z4 and all the others would be (4D) vectors:

#declare X6=<6, 0, 0, 1>;
#declare Y5=<0, 5, 0, 1>;
#declare Z4=<0, 0, 4, 1>;
#declare X2YZ3=<2, 1, 3, 1>;
#declare Const=<0, 0, 0, 1>;

And the macro would just have to analyze the components of the vectors and
place 'Vector.t' at the appropriate positions in the poly object.  I
currently don't have the time to write it, but it's really quite easy
(although it would take some time to parse for a 15th order poly).  

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

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