Hi,
I'm building a reactable like and got a "virtual-physical" prob ..
I created different "cubes" to put on the table reconized by reactivision,each one associated to a object in PD.
On of these is able to contol 4 parameters with 1 cube, when i put it on the table, 4 button are draw near this cube (in gem) and when i touch these buttons it activate the contol
of the parameters, when i rotate the cube, it change the selected parameter value.
Ex: touch param button 1 and rotate the cube to 120 deg, then touch button param2 and rotate to 90deg. (the value for param 1 will be 120 and for param2 will be 90 ).When i touch again the button param 1 it re-set the value to 120deg.
But my prob is that the stored value (virtual) is re-set to 120 degrees but physicaly the cube is on 90 degrees and when start to rotate it again it take the physical value and start from 90deg. (because the cube is physicaly at this angle)
My idea to resolve this was to add or substract only the variation of the angle to the stored one, then if i rotate the cube 30 deg more it will add it to the intial 120 = 150.
i don't know exactly how to do this (newbie on pd) because for example if i add 40deg to 350 then it should be 30 deg and not 390
i'm sorry for my bad english and it is quite difficult to explain..
if someone know how to calculate in degrees or radian i would be happy ..
Many thanks in advance
Nico