POV-Ray : Newsgroups : povray.newusers : object parameters : Re: object parameters Server Time
25 Apr 2024 17:38:47 EDT (-0400)
  Re: object parameters  
From: William F Pokorny
Date: 15 Feb 2023 10:53:05
Message: <63ecffe1$1@news.povray.org>
On 2/15/23 07:20, William F Pokorny wrote:
> #declare Vec00_Xfrmed =
> <FnXfrm00(Vec00.x,Vec00.y,Vec00.z).x,
> FnXfrm00(Vec00.x,Vec00.y,Vec00.z).y,
> FnXfrm00(Vec00.x,Vec00.y,Vec00.z).z>;

The light went on in my head a minute ago that I'd coded the part above 
without thinking. It can be just:

#declare Vec00_Xfrmed = FnXfrm00(Vec00.x,Vec00.y,Vec00.z);

---

That said, Tor Olav's suggestions are the cleaner method from the users 
perspective. Internally those macros use the function based code too.

The best approach for performance depends on what you are doing. Using a 
single transform against a lot of vectors will favor raw coding approach 
where the transform function can be parsed, compiled and defined once. 
If many transforms against few vectors, the macro's are the way to go.

Bill P.


Post a reply to this message

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