Matrix Array in C# script

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
VincentPix
Posts: 39
Joined: 06 Nov 2014, 15:07

Matrix Array in C# script

Post by VincentPix » 06 Feb 2016, 13:23

Hello,

I'm trying to work with a Matrix Array (an array of transform matrices) and I can't find how to assign a matrix to each index.

something like :

MatrixArray[0] = Matrix1;

If someone has some hints to help...

Have a nice day !

TVM Cracklings
Posts: 33
Joined: 30 Sep 2015, 10:49

Re: Matrix Array in C# script

Post by TVM Cracklings » 07 Feb 2016, 07:33

It shouldn't be any different to arrays of any other type.

Are you assigning to the "output matrix" directly? In that case, it wouldn't work, since the output is only allowed to be created once. You'd need something like

Code: Select all

MatrixType[] MOut = new MatrixType[xyz];
// ... assign values to MOut
MatrixArray = MOut;
Maybe some code and/or debugging infos?

Regards
-C

clearMa

Re: Matrix Array in C# script

Post by clearMa » 23 Feb 2016, 07:45

you two help me solve a big problem!!thank you very much

VincentPix
Posts: 39
Joined: 06 Nov 2014, 15:07

Re: Matrix Array in C# script

Post by VincentPix » 23 Feb 2016, 12:42

Thank you very much for your answer which solved a part of my problem.
The second part is : the "MatrixType"
I have miss something but I can't find the right way to decare it. Should I declare a namespace first ?

Thank you.

VincentPix
Posts: 39
Joined: 06 Nov 2014, 15:07

Re: Matrix Array in C# script

Post by VincentPix » 23 Feb 2016, 18:01

I found !

1st Declare a namespace just after the "using VentuzKernel;" :

using SlimDx;


2nd to declare a new matrix array :

Matrix[] MyMat = new Matrix[5];

Have fun.

Post Reply