POV-Ray : Newsgroups : povray.advanced-users : A couple of questions about matrix transformations : Re: A couple of questions about matrix transformations Server Time
29 Jul 2024 02:31:42 EDT (-0400)
  Re: A couple of questions about matrix transformations  
From: Tor Olav Kristensen
Date: 2 Apr 2003 20:04:19
Message: <Xns93521F8972505torolavkhotmailcom@204.213.191.226>
Tor Olav Kristensen <tor_olav_kCURLYAhotmail.com> wrote in 
news:Xns### [at] 204213191226:

...
> #macro invertMatrix33(MM)
> 
>   #local vX = <MM[0][0], MM[0][1], MM[0][2]>;
>   #local vY = <MM[1][0], MM[1][1], MM[1][2]>;
>   #local vZ = <MM[2][0], MM[2][1], MM[2][2]>;
>   #local Det = det3D(vX, vY, vZ);
>   #local v0 =  vcross(vY, vZ)/Det;
>   #local v1 = -vcross(vX, vZ)/Det;
>   #local v2 =  vcross(vX, vY, vT)/Det;
> 
>   array[3][3] {
>     { v0.x, v1.x, v2.x }
>     { v0.y, v1.y, v2.y }
>     { v0.z, v1.z, v2.z }
>   }
> 
> #end // macro invertMatrix33
...

It seems that my last minute corrections
to this macro did not make into my post.

Here's the correct line for v2:

  #local v2 =  vcross(vX, vY)/Det;


Sorry about that.


Tor Olav


Post a reply to this message

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