POV-Ray : Newsgroups : povray.unofficial.patches : vectors.inc Attn: Tor Olav (povr branch work) : Re: vectors.inc Attn: Tor Olav (povr branch work) Server Time
10 Aug 2022 16:40:41 EDT (-0400)
  Re: vectors.inc Attn: Tor Olav (povr branch work)  
From: Tor Olav Kristensen
Date: 28 May 2021 18:55:00
Message: <web.60b172f7633c4bc4306a434089db30a9@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> OK, I think I've gotten your vectors.inc merged into - and alongside -
> the core includes of my povr branch. With vectors.inc becoming one of
> the core include files.

Good =)


> Ended up... Sometimes wrapping macros in transforms.inc and math.inc to
> call your versions. Sometimes leaving the existing, roughly-equivalent
> macros but recommending your version in comments - and using yours over
> the old versions otherwise in the core include files.

I'm a bit worried about the wrapping solution. That is because I'm contemplating
a minor change in either the OrthogonalVector() macro or the
AltOrthogonalVector() macro.

If one pass the same vector to both of these, I want the resulting vectors to
always be orthogonal to each other in addition to being orthogonal to the
vector passed to the macros.

Right now it is mostly so. But if if all the components in the passed vector are
equal, this will not be the case (except for the case were the passed vector is
the zero vector).

To fix this I would prefer to change the order of the "ifs" in the
OrthogonalVector() macro.

If the old VPerp_To_Vector() macro is changed to call (wrap) the new
OrthogonalVector() with reordered "ifs", it will break scenes using the
VPerp_To_Vector() macro.

So now I'm not sure what to do...


> As anticipated some minor changes in declared IDs due povr's lower case
> checking.
>
> Added basic self testing of all the macros as a block appended to the
> bottom.
>
> Turned out well. Thank you!

Thank you too !

I tried to look for your new core include files at your github pages, but I
could not find them there. Are they visible somewhere else ?


> Only suggestion I'll make has to do with the documentation on your
> github page at: ttps://github.com/t-o-k/Useful-POV-Ray-macros.
>
> With the VectorsFromTransform() and VectorsFromTransformFunction(),
> where you are showing the initialization of v_X, v_Y, v_Z and p_T, ahead
> of the macro calls; you could use the, new to v3.8, tuple initialization
> syntax. For example:
>
> #declare (v_X,v_Y,v_Z,p_T) = (<0,0,0>,<0,0,0>,<0,0,0>,<0,0,0>);

I had forgotten about this new initialization type. I've now changed the
examples to use it.

I've also changed the parameter names of the AccurateAngleBetweenVectors()
macro, so that are in line with the names in the other macros.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


Post a reply to this message

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