Hi,
I'm trying to implement circular scrolling with the trackpad in pd and am approaching it by dividing a circle into segments and trying to detect when the mouses moves from one segment to the other. At the moment I can only detect 4 segments (basically just the zero crossings) which is not really accurate enough.
How would I go about detecting the boundaries of the 12 segments in the attached patch (circscroll.pd)?
Eventually I want to detect speed and direction too - but perhaps there is a better approach?
any advice welcome.
thanks,
james
I would convert the x,y coords from the trackpad to polar coords, then you have angle and radius. Check out [mapping/polar], note that's meant to work with absolute coords like what you get from [cursor] or [mousestate]. [hid] will give you the relative data that mouse sensor gives.
.hc
On Jan 6, 2013, at 4:28 PM, James Dunn wrote:
Hi,
I'm trying to implement circular scrolling with the trackpad in pd and am approaching it by dividing a circle into segments and trying to detect when the mouses moves from one segment to the other. At the moment I can only detect 4 segments (basically just the zero crossings) which is not really accurate enough.
How would I go about detecting the boundaries of the 12 segments in the attached patch (circscroll.pd)?
Eventually I want to detect speed and direction too - but perhaps there is a better approach?
any advice welcome.
thanks,
james <circscroll.pd><circscrollabs.pd>_______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hello,
what about converting cartesian to polar coordinates instead?
with something like
angle = atan(y/x)
you can even get the distance from the center with
R = Sqrt(x2 + y2)
that should be a lot easier
----- Mail original -----
De: "James Dunn" james@4thharmonic.com À: "pd-list" pd-list@iem.at Envoyé: Dimanche 6 Janvier 2013 22:28:30 Objet: [PD] Circular scrolling in pd
Hi,
I'm trying to implement circular scrolling with the trackpad in pd and am approaching it by dividing a circle into segments and trying to detect when the mouses moves from one segment to the other. At the moment I can only detect 4 segments (basically just the zero crossings) which is not really accurate enough.
How would I go about detecting the boundaries of the 12 segments in the attached patch (circscroll.pd)?
Eventually I want to detect speed and direction too - but perhaps there is a better approach?
any advice welcome.
thanks,
james
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
thanks, cart2pol in zexy works great for me
James
Quoth Patrice Colet, on 06/01/2013 22:02:
hello,
what about converting cartesian to polar coordinates instead?
with something like
angle = atan(y/x)
you can even get the distance from the center with
R = Sqrt(x2 + y2)
that should be a lot easier
----- Mail original -----
De: "James Dunn" james@4thharmonic.com À: "pd-list" pd-list@iem.at Envoyé: Dimanche 6 Janvier 2013 22:28:30 Objet: [PD] Circular scrolling in pd
Hi,
I'm trying to implement circular scrolling with the trackpad in pd and am approaching it by dividing a circle into segments and trying to detect when the mouses moves from one segment to the other. At the moment I can only detect 4 segments (basically just the zero crossings) which is not really accurate enough.
How would I go about detecting the boundaries of the 12 segments in the attached patch (circscroll.pd)?
Eventually I want to detect speed and direction too - but perhaps there is a better approach?
any advice welcome.
thanks,
james
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list