problems with Matrix.

Technical questions, etc..
Shell1850
Chief Petty Officer
Posts: 135
Joined: 21 May 2009, 21:44

problems with Matrix.

Post by Shell1850 »

I am trying to get this example to work. Every time the program executes a.SetAt(0,0,1) I get the error a Microsoft JScript runtime error. Description - Invalid procedure call or argument. Any suggestions.


var a = System.CreateDO("Common Data Package/Int Array Data");
a.SetDim(3);
a.SetSize(3,3,3);

a.SetAt(0,0,1);

I tried it with ts 7.6 and 7.61. It fails with jscript object and jscript command.
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: problems with Matrix.

Post by froo »

This problem looks familiar.
I do not remember the answer at the moment, but let me think on it,
and try some experiments.
User avatar
marcel
Captain
Posts: 2247
Joined: 21 May 2009, 19:52
Type the number ten into the box: 0
Location: paris - France

Re: problems with Matrix.

Post by marcel »

If you have a problem with Matrix request to Neo. :D
Design - illustration - Animation
http://www.crea-vision.fr
User avatar
MikomDude
Captain
Posts: 1930
Joined: 04 Oct 2010, 11:12
Type the number ten into the box: 0
Location: The Hague, Netherlands

Re: problems with Matrix.

Post by MikomDude »

Good one Marcel, I was about to say the same thing. ;)
Shell1850
Chief Petty Officer
Posts: 135
Joined: 21 May 2009, 21:44

Re: problems with Matrix.

Post by Shell1850 »

Thanks froo.


i have not seen the movie.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: problems with Matrix.

Post by clintonman »

if I do:

var a = System.CreateDO("Common Data Package/Int Array Data");
a.SetDim(3);
a.SetSize(3,3,3);

a.SetAt(0,0,1,7);

I get no error. Note the 4th argument for the value. This was just a quick test so i don't know if it really works.
Clinton Reese

http://clintons3d.com
Shell1850
Chief Petty Officer
Posts: 135
Joined: 21 May 2009, 21:44

Re: problems with Matrix.

Post by Shell1850 »

Thanks clintonman.

I see where I made the mistake. SetSize(3,3) makes a 3x3 Matrix. SetSize(3,3,3) makes a 3x3x3 Matrix.
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: problems with Matrix.

Post by froo »

I was gonna say; your original SetAt() function didn't quite look right.
But I wanted to confirm, before I said anything. :)

Glad you got it worked out Shell! :D
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: problems with Matrix.

Post by froo »

clintonman wrote:if I do:

var a = System.CreateDO("Common Data Package/Int Array Data");
a.SetDim(3);
a.SetSize(3,3,3);

a.SetAt(0,0,1,7);

I get no error. Note the 4th argument for the value. This was just a quick test so i don't know if it really works.
To confirm if this works, you should be able to then do something similar to this:

System.Alert( a.GetAt(0,0,1);

This should display a dialog, with the text set to, the value 7
Shell1850
Chief Petty Officer
Posts: 135
Joined: 21 May 2009, 21:44

Re: problems with Matrix.

Post by Shell1850 »

Thanks froo.

I must have had a Homer Simpson moment this morning.

I am trying to learn Linear Algebra and integrate the homework into Truespace.

Return to “TechForum”