distinguish distance by new point added
in
Contributed Library Questions
•
2 months ago
Greetings!
I am working with the Leapmotion and I am trying to see the distance between two points (i.e. when a new ellipse is added to the scene) and calculate their distance from each other.
if anyone can offer suggestions on how to tackle this, it is greatly appreciated.
code below:
- import com.onformative.leap.LeapMotionP5;
- import com.leapmotion.leap.Finger;
- LeapMotionP5 leap;
- //euclidean distance
- public void setup() {
- size(500, 500);
- leap = new LeapMotionP5(this);
- }
- public void draw() {
- background(0);
- fill(255);
- for (Finger finger : leap.getFingerList()) {
- PVector fingerPos = leap.getTip(finger);
- ellipse(fingerPos.x, fingerPos.y, 10, 10);
- }
- }
- public void stop() {
- leap.stop();
- }
1