this is a simple example showing how to control objects in BGE with an android phone.
To work, it uses a free android market application called andOSC, and liblo + pyliblo libraries. You can get a little more info here
Also detailed instructions to get it working are inside the blend file, where the scripts are too.
hope you enjoy…
and now the questions:______________________________________ XD
i know it’s far to perfect implementation, i want to improve it, by stopping the rotation when the object reach the phone orientation.
Now i need to apply opposite rotation to stop it, because i used applytorque to get smooth movement, but i can’t find how to convert the orientation matrix i get from the object in order to get it stopped at the end of the roll.
I mean, andOSC send tree degrees (one for each axis), and applytorque get this vector (in radians), but when i call for cube.orientation blender gives me a matrix. How can i convert this matrix to one degree for axis?
The other question is…
I used a piece of code from mike pan’s example of mouse and camera movement in bge, to get orientation working:
cube.applyTorque([rx,ry,0], True)
cube.applyTorque([0,0,rz], False)
why i cant use this —> cube.applyTorque([rx,ry,rz], True) ???
(the object gets crazy but i dont know why)
and sorry for such a long explanation…
Attachments
blender-meet-android.blen.blend (687 KB)