Dial object relative to mouse/finger position
Hello,
I'm in the middle of developing a touch screen user interface and have an issue with dial. So far I have converted the cartesian input of the x,y finger tracking into polar coordinates, this gives me a nice circular tracking motion with the dial object.
My problem is that when I touch the dial the needle and therefore the output of the dial jumps to my finger position. I need the dial to move relative to my finger.
I have tried to figure out the logic but I'm going round in circles if you'll excuse the pun.
Any suggestions?
Assuming you know (i.e., you have stored) the current dial position, then what I'd suggest doing is: when the user touches the dial, store that xy coordinate, and then compare each subsequent finger location to that to get the user's change in angle, and use that change in angle to produce a corresponding change in the dial value. I don't have time to make an example patch right now, but I hope this idea will get you started.