POV-Ray : Newsgroups : povray.advanced-users : Reorient_Trans macro details : Re: Reorient_Trans macro details Server Time
14 Apr 2024 04:37:09 EDT (-0400)
  Re: Reorient_Trans macro details  
From: Bald Eagle
Date: 8 Feb 2024 13:25:00
Message: <web.65c51b647ecd0aa1f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I'm gonna write an alternate form of the macro that uses the inverse keyword
> just to make sure it does exactly the same thing.

And indeed, using the following gives the same results.
Note that you have to enclose the second matrix in its own transform {}, else
the inverse gets applied to the whole 2-matrix transform instead of just the
second matrix.

transform {
 matrix <
 Vec_1.x, Pboth.x, Perp1.x,
 Vec_1.y, Pboth.y, Perp1.y,
 Vec_1.z, Pboth.z, Perp1.z,
   0,    0,    0    >

 transform {
  // Column vectors like above
  matrix <
  Vec_2.x, Pboth.x, Perp2.x,
  Vec_2.y, Pboth.y, Perp2.y,
  Vec_2.z, Pboth.z, Perp2.z,
    0,     0,     0  >
  inverse // <--- Inverse

Post a reply to this message

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