Drawing Tablet Library For Processing
marcus • March 18th, 2008
libTablet aims at becoming a (cross-platform) Java drawing tablet library that plays nice with Processing. It gives you easy access to your tablets pressure, tilt and rotational data in your sketches/ Java applications.
Since my most immediate requirement currently is to have it working on Mac OS X, it is yet not really cross-platform. However the plan is to wrap JTablet on Windows to provide a common interface for easier development/ deployment across these systems.
Releases
version 0.1
first draft, mac os x only
» Tablet-0.1.zip
Source
You can get the latest version via mercurial with:hg clone http://hg.infostuka.org/hg/libTablet/ |
Useage
Simply create a PTablet object before you initialize your sketch, which you can then use to query your tablet for: pressure, tiltX, tiltY, rotation etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import processing.opengl.*;
import infostuka.lib.tablet.p5.*;
PTablet tablet;
void setup ()
{
// ATTENTION - new PTablet() HAS to be created before calling size()
tablet = new PTablet(this);
size(800, 600, OPENGL);
}
void draw ()
{
if (mousePressed) {
float brushSize = tablet.pressure * 100f;
System.out.println("TILT " + tablet.tiltX + " " + tablet.tiltY + " ROT " + tablet.rotation + " THETA " + theta);
...
your drawing commands here
...
}
}
|
License
Copyright © Marcus Wendt 2008
This library is licensed under the GNU LGPL
Permalink

