glv
April 27, 2021, 1:56pm
3
@psemme ,
A couple of ways… I a sure there are many more.
Consider:
You could draw a circle and then a line and use get(x, y) to detect where it intersects.
I have used this technique to detect intersections of objects with a curve and following a curve.
Emulate a rotary encoder:
Hello,
Thanks for asking this! Had some fun with it…
Sharing my initial steps…
I did not look at other examples.
Create a PGraphic image. I used random circles but this could be your encoded wheel or anything.
Move the mouse over the canvas to detect colors.
Do something with the detected colors.
The rest is up to your creativity and imagination. I used the same concepts in the past to do something similar.
In my example the mouse location turned red or green depending on color it detected…
:)
1 Like