multiple inputs acting on a polygon
Posted: Thu Apr 30, 2009 3:49 pm
I am working on a project that uses multiple inputs (i.e. finger tracked input) to interaction with polygons. Right now I am emulating the multiple inputs by capturing separate mouse clicks as their own input object (joint and all to a polygon) and the current mouse object being the only input that can move, the others are static (sometimes I have a moving function to simulate movement for the capture input(s)).
With this I am trying to simulate a rotation of a polygon using two inputs where one input acts like an anchor and the other determines the rotation direction or the two inputs rotate causing the polygon to rotate (much like when you rotate an object on a table with 2 fingers). At first I thought I would just have to have two inputs in which one or both perform a drag operation. But this does not work. The polygon stays with my moving mouse and leaves behind the captured point and when the captured point has a move function to simulate independent movement, the polygon still does not rotate as I would expect - it stays with my moving mouse input.
I just want to try and get rotation for free from the physics engine using two inputs without having to do much of my own calculations. Any ideas? Thanks
FYI: I am using Pymunk, the python wrapper for Chipmunk.
With this I am trying to simulate a rotation of a polygon using two inputs where one input acts like an anchor and the other determines the rotation direction or the two inputs rotate causing the polygon to rotate (much like when you rotate an object on a table with 2 fingers). At first I thought I would just have to have two inputs in which one or both perform a drag operation. But this does not work. The polygon stays with my moving mouse and leaves behind the captured point and when the captured point has a move function to simulate independent movement, the polygon still does not rotate as I would expect - it stays with my moving mouse input.
I just want to try and get rotation for free from the physics engine using two inputs without having to do much of my own calculations. Any ideas? Thanks
FYI: I am using Pymunk, the python wrapper for Chipmunk.