8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AtraeAdvent Calendar 2015

Day 23

ProcessingをLeapmotoinで動かしてみた

Posted at

年末だし久々にProcessingでも触ろうかと思ったのでメモ。

使ったライブラリはこれ
https://github.com/onformative/LeapMotionP5

gitからzipファイルをDLして解答すると
「LeapMotionP5-master」
って名前なので↓の画像のように名前を変更してライブラリフォルダに突っ込む
スクリーンショット 2015-12-27 17.57.26.png

とりあえずREADME.mdに書いてあるサンプルを実行してみる

sketch_1.pde
import com.onformative.leap.LeapMotionP5;
import com.leapmotion.leap.Finger;

LeapMotionP5 leap;

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();
}

こんな感じです。
sketch_1-compressor.gif

これだけじゃ味気ないので、拾い物のパーティクルと組み合わせて
sketch_2-compressor.gif

こんな感じです。

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?