POV-Ray : Newsgroups : povray.advanced-users : One works one doesn't? : One works one doesn't? Server Time
29 Jul 2024 18:27:33 EDT (-0400)
  One works one doesn't?  
From: Dan Johnson
Date: 16 Jun 2001 02:09:07
Message: <3B2C49EC.D29C629E@hotmail.com>
The bottom uncommented one works given good data, but won't given bad
data.  The top one tries to correct for user error, but instead
generates errors every time.  

/*#macro Quaternion(Angle,Vector)   // creates a normalized rotation
quaternion... angle in radians
        #if (vlength(Vector)=0) 
         #warning "0 vector not allowed\nUsing identity Quaternion" 
         <1,0,0,0>
        #else
         #local A = Angle/2;
         #local V = sin(A)*vnormalize(Vector);
         <cos(A),V.x,V.y,V.z>
        #end
#end*/
#macro Quaternion(Angle,Vector)   //Old version
        #if (vlength(Vector)=0) #warning "0 vector not allowed" #end
        #local A = Angle/2;
        #local V = sin(A)*vnormalize(Vector);
        <cos(A),V.x,V.y,V.z>
#end

-- 
Dan Johnson 

http://www.geocities.com/zapob


Post a reply to this message

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