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 21:18:51 EDT (-0400)
  Re: QSample1.pov - Basic sample for using quaternions.inc for rotation  
From: None
Date: 8 Oct 2003 18:12:54
Message: <Xns940EB949C216FNone@204.213.191.226>
Tor Olav Kristensen <tor_olav_kCURLYAhotmail.com> wrote in 
news:Xns### [at] 204213191226:

> 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.
> [...]

Thanks for clearing that.  Oh, and just in case you may think I'm not 
reading your suggestions (after that ln() thing), I feel I need to 
explain why I opted not to use some of your suggestions:

Let's take for example:
  #if (R > 0)
    #local S = sin(R)/R;
  #else
    #local S = 0;
  #end // if

  (Et*<S*Q.x, S*Q.y, S*Q.z, cos(R)>)

I've decided to leave it as:
  #if (R > 0)
    #local S = ET*sin(R)/R;
  #else
    #local S = 0;
  #end
  <S*Q.x,S*Q.y,S*Q.z,ET*cos(R)>

Simply for performance issues.  I realize it's not much, but the first 
one will have two more multiplications if R>0 and will have three more 
multiplications if R <= 0.  And perhaps, it's simply a coding style as 
well.

But I do appreciate any and all input, it helps.


Post a reply to this message

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