Page 1 of 1

Newbie coordinate question

PostPosted: Wed Feb 10, 2010 10:38 pm
by izacque
so I'm new to thyme, and for my first project, I'd like to know how to set a variable to the X coordinate of an object, and to set another variable to the Y coordinate. Also, is it possible to use a matrix for the X values and another matrix for the Y values, and then have objects each write their coordinates into different matrix slots? Thanks in advance for your help :D

Re: Newbie coordinate question

PostPosted: Thu Feb 11, 2010 2:44 am
by KarateBrot
To read preexisting variables like the position you have to use "new method" / "method-x". But then it's possible. So if you used this method you can add the x and y values to a matrix. For example

Code: Select all
scene.my.posX = scene.my.posX ++ [e.pos(0)]
Scene.my.posY = scene.my.posY ++ [e.pos(1)]

Re: Newbie coordinate question

PostPosted: Thu Feb 11, 2010 2:53 am
by Versieon
Are you sure you have to use the new method, i belive you can read position regularly

Re: Newbie coordinate question

PostPosted: Thu Feb 11, 2010 2:56 am
by KarateBrot
Oh yeah of course, sorry. But you can't read it directly off of the object. You have to attach an object to it and also a laser / beacon to read e.pos of the collision / laser event out from the middle of the object or where you want it to be.

Re: Newbie coordinate question

PostPosted: Thu Feb 11, 2010 3:10 am
by Antotabo
Download the K-probe on algobox. Really useful gadget from Killinich. It gave plenty of information like RPM, position, velocity ... 100 time per second.

Re: Newbie coordinate question

PostPosted: Thu Feb 11, 2010 5:02 am
by standardtoaster
Or you can save yourself a lot of variables and make one yourself.

Re: Newbie coordinate question

PostPosted: Fri Feb 12, 2010 1:16 am
by izacque
thanks guys, I was actually planning to use a beacon-detector system, so that's not a problem. I won't download the K-Probe. that Would be cheating. and I know enough about algodoo and thyme to make my own beacon without instructions. :P