|
![](/i/fill.gif) |
Dan Johnson wrote:
Fixed all the other known bugs in my code this weekend. I still don't
know why the first one of these doesn't work, and the second one does.
<snip>
> /*#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
<snip>
--
Dan Johnson
http://www.geocities.com/zapob
Post a reply to this message
|
![](/i/fill.gif) |