POSITION X
4 posts • Page 1 of 1
POSITION X
as applying only position on the x axis? , Example: any vector a1 = [1.0,1.2,1.3], only change the index of this vector as 0? , The position vector does not work like I did: pos (0) = (-0.046975), not simply because it works? , How to get stuck in a position of X axis and Y axis is free?
- E4e17
- Posts: 5
- Joined: Fri Sep 20, 2013 2:55 pm
Re: POSITION X
how to change only the value of the X (index 0) axis in the vector of position?
- E4e17
- Posts: 5
- Joined: Fri Sep 20, 2013 2:55 pm
Re: POSITION X
You can't set variables in arrays shamefully, however, it's pretty easy to work around this in fixed lengh arrays.
e.this.pos = "[" + scene.my.x + "," + e.this.pos(1) + "]"
When that is evaluated, is should produce a string: such as [8, 9], which will be parsed as an array.
I can't test the code right now, but I can't see why that code wouldn't work. I've built arrays using string concatenation before in algodoo, and it always works fine.
e.this.pos = "[" + scene.my.x + "," + e.this.pos(1) + "]"
When that is evaluated, is should produce a string: such as [8, 9], which will be parsed as an array.
I can't test the code right now, but I can't see why that code wouldn't work. I've built arrays using string concatenation before in algodoo, and it always works fine.
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
Re: POSITION X
soo thank you , its work perfect here ,
- E4e17
- Posts: 5
- Joined: Fri Sep 20, 2013 2:55 pm
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 24 guests