|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have a matrix:
matrix
<
CamR.x, CamR.y, CamR.z,
CamU.x, CamU.y, CamU.z,
CamD.x, CamD.y, CamD.z,
CamL.x, CamL.y, CamL.z
>
What is the inverse?
Thanks.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/14/2009 11:27 PM, SharkD wrote:
> I have a matrix:
>
> matrix
> <
> CamR.x, CamR.y, CamR.z,
> CamU.x, CamU.y, CamU.z,
> CamD.x, CamD.y, CamD.z,
> CamL.x, CamL.y, CamL.z
> >
>
> What is the inverse?
>
> Thanks.
>
> Mike
Nevermind. I found some code to do it here:
http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/index.htm
Do I need to flip the POV-Ray matrix first? In POV-Ray, translation
occurs in the last *row*, whereas in the page I linked to translation
occurs in the last *column*.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/15/2009 2:45 AM, SharkD wrote:
> Nevermind. I found some code to do it here:
>
> http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/index.htm
>
>
> Do I need to flip the POV-Ray matrix first? In POV-Ray, translation
> occurs in the last *row*, whereas in the page I linked to translation
> occurs in the last *column*.
>
> Mike
Also, when applying the matrix to a vector instead of an object (i.e.
using an array), do I multiply by a 1x3 matrix? Is this matrix vertical
or horizontal?
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD schrieb:
> I have a matrix:
>
> matrix
> <
> CamR.x, CamR.y, CamR.z,
> CamU.x, CamU.y, CamU.z,
> CamD.x, CamD.y, CamD.z,
> CamL.x, CamL.y, CamL.z
> >
>
> What is the inverse?
transform {
matrix <
CamR.x, CamR.y, CamR.z,
CamU.x, CamU.y, CamU.z,
CamD.x, CamD.y, CamD.z,
CamL.x, CamL.y, CamL.z
>
inverse
}
:-P
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/15/2009 3:31 PM, clipka wrote:
> (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.)
Awesome! I wasn't aware of the vtransform function. Thanks!
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Is there an easy way to combine multiple transformations? I tried each
of the following:
#local trans_c = transform
{
transform {trans_a}
transform {trans_b}
}
#local trans_c = transform
{
trans_a + trans_c
}
#local trans_c = trans_a + trans_b
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 11/15/2009 11:23 PM, SharkD wrote:
> Is there an easy way to combine multiple transformations? I tried each
> of the following:
>
> Mike
Nevermind. There was a typo in my working code. The first example works.
Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|