|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have now created a new Github repository with POV-Ray macros that I think is
useful.
https://github.com/t-o-k/Useful-POV-Ray-macros
The vectors.inc file contains these vector related macros:
ScalarTripleProduct()
VectorTripleProduct()
VectorCos()
VectorSin()
AngleBetweenVectors() <-- VAngle() in math.inc
AccurateAngleBetweenVectors()
ScalarProject()
VectorProject() <-- VProject_Axis() in math.inc
ScalarReject()
VectorReject() <-- VProject_Plane() in math.inc
OrthogonalVector() <-- VPerp_To_Vector() in math.inc
AltOrthogonalVector()
VectorAxisRotate() <-- Built in vaxis_rotate()
VectorReorient()
VectorTransform() <-- vtransform() in vtransforms.inc
VectorInverseTransform() <-- vinv_transform() in vtransforms.inc
MatrixTransform() <-- Matrix_Trans() in transforms.inc
AxisRotateTransform() <-- Axis_Rotate_Trans() in transforms.inc
ReorientTransform() <-- Reorient_Trans() in transforms.inc
At the moment the macros are made for POV-Ray v3.7,
but they should also work in v3.8.
There are links to relevant Wikipedia articles in the file.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Tor Olav Kristensen wrote on 16/05/2021 18:10:
>
> I have now created a new Github repository with POV-Ray macros that I think is
> useful.
>
> https://github.com/t-o-k/Useful-POV-Ray-macros
>
> The vectors.inc file contains these vector related macros:
>
[...]
> At the moment the macros are made for POV-Ray v3.7,
> but they should also work in v3.8.
>
> There are links to relevant Wikipedia articles in the file.
>
> --
> Tor Olav
> http://subcube.com
> https://github.com/t-o-k
>
>
Thank you, useful and practical to use.
Paolo
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Should the POV-Ray links pages be moved to the wiki?
Mike
On 5/16/2021 12:10 PM, Tor Olav Kristensen wrote:
>
> I have now created a new Github repository with POV-Ray macros that I think is
> useful.
>
> https://github.com/t-o-k/Useful-POV-Ray-macros
>
> The vectors.inc file contains these vector related macros:
>
> ScalarTripleProduct()
> VectorTripleProduct()
> VectorCos()
> VectorSin()
> AngleBetweenVectors() <-- VAngle() in math.inc
> AccurateAngleBetweenVectors()
> ScalarProject()
> VectorProject() <-- VProject_Axis() in math.inc
> ScalarReject()
> VectorReject() <-- VProject_Plane() in math.inc
> OrthogonalVector() <-- VPerp_To_Vector() in math.inc
> AltOrthogonalVector()
> VectorAxisRotate() <-- Built in vaxis_rotate()
> VectorReorient()
> VectorTransform() <-- vtransform() in vtransforms.inc
> VectorInverseTransform() <-- vinv_transform() in vtransforms.inc
> MatrixTransform() <-- Matrix_Trans() in transforms.inc
> AxisRotateTransform() <-- Axis_Rotate_Trans() in transforms.inc
> ReorientTransform() <-- Reorient_Trans() in transforms.inc
>
> At the moment the macros are made for POV-Ray v3.7,
> but they should also work in v3.8.
>
> There are links to relevant Wikipedia articles in the file.
>
> --
> Tor Olav
> http://subcube.com
> https://github.com/t-o-k
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Mike Horvath <mik### [at] gmailcom> wrote:
> Should the POV-Ray links pages be moved to the wiki?
>...
Hi Mike
I'm not sure if that question was meant for me. But if it was - and if you if
you are referring about this page (which is probably very outdated by now):
http://www.povray.org/resources/links/
- then my opinion is that we should try that.
I also think that we should add a date for when the link was last verified, so
that the link collection is easier to maintain.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> I also think that we should add a date for when the link was last verified, so
> that the link collection is easier to maintain.
I know that there used to be a trivial way to have the webpage automatically
check all the links and grey-out any dead/invalid links.
I can't recall the exact format that I used to use, but I believe that it has
evolved into xml.
But yes, dates are nice, but I vote for the greying-out mechanism as well, if at
all possible.
(And if we're playing with hyperlink color schemes, I'd like a bit more
differentiation between the unvisited links and visited links, because they
appear far too similar in the message digest lists)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 5/16/21 12:10 PM, Tor Olav Kristensen wrote:
>
> I have now created a new Github repository with POV-Ray macros that I think is
> useful.
>
> https://github.com/t-o-k/Useful-POV-Ray-macros
>
...
Cool! Very clean work as always. On my list to play with these macros
along with your suggested stats updates.
---
A comment on local variables.
Where you have multiple references to a local variable, the symbol
definition and look up is likely clearer and faster.
Where you have a local variable with only one reference, however, the
symbol definition and look up is all overhead. There isn't any
optimization which removes / streamlines the operations within macros.
There's a clarity vs performance trade-off in the single reference to
local variable case.
Bill P.
--- Ref.
A millsion calls.
AngleBeteenVectors without Dot
-----------------------------
9.66user 5.30system 0:15.48elapsed
9.54user 5.44system 0:15.51elapsed
9.52user 5.49system 0:15.54elapsed
9.76user 5.14system 0:15.44elapsed
"9.66 9.54 9.52"
AngleBeteenVectors with Dot local var
-------------------------------------
10.19user 5.58system 0:16.29elapsed
10.36user 5.39system 0:16.27elapsed
10.21user 5.48system 0:16.22elapsed
10.44user 5.48system 0:16.44elapsed
"10.19 10.36 10.21" 28.72 -> 30.76 ---> +7.10%
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> At the moment the macros are made for POV-Ray v3.7,
> but they should also work in v3.8.
If a macro is made for version 3.7, then, it will run in version 3.8.
To my knowledge, anything that works in version 3.3 to 3.7 will run in 3.8.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 5/17/2021 6:43 AM, Tor Olav Kristensen wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> Should the POV-Ray links pages be moved to the wiki?
>> ...
>
> Hi Mike
>
> I'm not sure if that question was meant for me. But if it was - and if you if
> you are referring about this page (which is probably very outdated by now):
>
> http://www.povray.org/resources/links/
>
> - then my opinion is that we should try that.
>
> I also think that we should add a date for when the link was last verified, so
> that the link collection is easier to maintain.
>
> --
> Tor Olav
> http://subcube.com
> https://github.com/t-o-k
>
>
Yes, all this could be moved to the wiki.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
>
> > I also think that we should add a date for when the link was last verified, so
> > that the link collection is easier to maintain.
>
> I know that there used to be a trivial way to have the webpage automatically
> check all the links and grey-out any dead/invalid links.
> I can't recall the exact format that I used to use, but I believe that it has
> evolved into xml.
>
> But yes, dates are nice, but I vote for the greying-out mechanism as well, if at
> all possible.
An automatic check feature that can flag problematic links sounds good.
But I guess that it will not be able to detect all place-holding and parasitic
web pages that any new domain owners have placed there instead of old pages. So
manual checks will probably also be needed.
> (And if we're playing with hyperlink color schemes, I'd like a bit more
> differentiation between the unvisited links and visited links, because they
> appear far too similar in the message digest lists)
Yes, I agree.
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
William F Pokorny <ano### [at] anonymousorg> wrote:
>...
> A comment on local variables.
>
> Where you have multiple references to a local variable, the symbol
> definition and look up is likely clearer and faster.
>
> Where you have a local variable with only one reference, however, the
> symbol definition and look up is all overhead. There isn't any
> optimization which removes / streamlines the operations within macros.
>
> There's a clarity vs performance trade-off in the single reference to
> local variable case.
Thank you for testing this Bill. - And for mentioning this performance issue.
As you say it's a clarity vs performance choice. Normally I prefer to go for
clarity and readability before performance. I also think that we should try to
make it easy for new users to learn from the code in the standard libraries. So
when I made those macros I tried to make it easy to recognize the parts that are
similar.
Further I think that descriptive, non cryptic variable names serve as part of
the documentation. (Some seem to think that programming in POV-Ray's SDL is a
continuous short code contest.)
But the macros in question are not so big and complicated, so I have followed
your advice and removed all but one of the local variables that are only
referenced once.
I have also rewritten a few of the macros slightly and added some new ones.
> A millsion calls.
>...
;)
--
Tor Olav
http://subcube.com
https://github.com/t-o-k
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |