POV-Ray : Newsgroups : povray.advanced-users : Inverse of matrix? : Re: Inverse of matrix? Server Time
1 Jul 2024 05:57:34 EDT (-0400)
  Re: Inverse of matrix?  
From: clipka
Date: 15 Nov 2009 15:31:46
Message: <4b006532$1@news.povray.org>
SharkD schrieb:
> On 11/15/2009 5:51 AM, clipka wrote:
>> :-P
> 
> OK, wow. That was easy!
> 
> However, I still need to know how to apply the matrix to a coordinate or 
> vector as opposed to an object.

#declare MyTransform = transform {
   matrix < ... >
}

#declare MyInverseTransform = transform {
   MyTransform // or directly specify the matrix here
   inverse
}

#include "transforms.inc"

#declare V2 = vtransform(V1, MyInverseTransform)
// or:
// #declare V2 = vinv_transform(V1, MyTransform)


(When applying the matrix to a direction vector - as opposed to a 
location vector, i.e. a point - make sure the matrix doesn't have a 
translation component, unless you're perfectly sure what you're doing.)


Post a reply to this message

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