3x3 matrix

On 14/01/2015 at 04:24, xxxxxxxx wrote:

Is there a way to do 3x3 matrix calculation like inverse mat.
I like to use it, to calculate the intersection of a line and a plane.

This problem is typically solved by expressing it in matrix form, and inverting it:
 \begin{bmatrix} t \\ u \\ v \end{bmatrix} = \begin{bmatrix} x_a - x_b & x_1 - x_0 & x_2 - x_0 \\ y_a - y_b & y_1 - y_0 & y_2 - y_0 \\ z_a - z_b & z_1 - z_0 & z_2 - z_0 \end{bmatrix}^{-1} \begin{bmatrix} x_a - x_0 \\ y_a - y_0 \\ z_a - z_0 \end{bmatrix}.

-Pim

On 14/01/2015 at 06:32, xxxxxxxx wrote:

Hello,

you can invert a Matrix with "__invert__()" or the Python "invert" operator "~" .

  
inverseMatrix = ~worldSpaceCoords  

You may also take a look at the GeRayCollider that can be used to calculate the intersections of a ray and a poly object.

best wishes,
Sebastian

On 14/01/2015 at 08:08, xxxxxxxx wrote:

Originally posted by xxxxxxxx

Hello,

you can invert a Matrix with "__invert__()" or the Python "invert" operator "~" .

 
inverseMatrix = ~worldSpaceCoords  

You may also take a look at the GeRayCollider that can be used to calculate the intersections of a ray and a poly object.

best wishes,
Sebastian

Yes, but that is all for a cinema 4d matrix and that is a 4x4 matrix, not a 3x3 matrix.
I want to use a 3x3 matrix.

I know I can use the GeRayCollider, but I want to do it myself.

So, how to do 3x3 matrix calculations in cinema 4d?

-Pim

On 15/01/2015 at 06:55, xxxxxxxx wrote:

Hello,

if you cannot use the existing classes and functions of the API you have to solve this problem like any other problem by implementing your own solution or using a existing library.

If you want to calculate the intersection of a ray and a triangle you do not necessarily need to handle Matrix objects. There are other algorithms like this one.

Best wishes,
Sebastian

On 15/01/2015 at 07:25, xxxxxxxx wrote:

Thanks, i will make my own 3x3 matrix calculation.
Thanks for the link.