POV-Ray : Newsgroups : povray.binaries.scene-files : quaternions.inc : Re: QSample1.pov - Basic sample for using quaternions.inc for rotation Server Time
28 Apr 2024 17:17:12 EDT (-0400)
  Re: QSample1.pov - Basic sample for using quaternions.inc for rotation  
From: Tor Olav Kristensen
Date: 8 Oct 2003 17:53:56
Message: <Xns940EF2EEA6ACBtorolavkhotmailcom@204.213.191.226>
None <Non### [at] onca> wrote in news:Xns### [at] 204213191226:

> Tor Olav Kristensen <tor_olav_kCURLYAhotmail.com> wrote in 
> news:Xns### [at] 204213191226:
> 
>>   #local R = f_r(Q.x, Q.y, Q.z);
> 
> Is "f_fr(x,y,z)" much faster than "sqrt( x*x + y*y + z*z )"?  I'm
> wondering because I don't find it reads better and perhaps the
> overhead of including "functions.inc" (if one wasn't using it in the
> first place) might not make it that beneficial?

Since f_r() is a built in function in POV-Ray, it should be a
little bit faster. But I doubt that you will be able to measure
any significant speed increase with it in your macros.

Here is how it is declared in functions.inc:

#declare f_r = function { internal(57) }

I just suggested using it because _I_ find it easy to read.
Maybe this comes from my extensive use of it within the
functions for my isosurfaces...

(Note that it isn't much overhead for POV-Ray to include
functions.inc.)



Tor Olav


Post a reply to this message

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