I was happily surprised how easy it was to get my Wacom USB-Tablet to work with the JTablet plugin by Cellosoft: http://www.cellosoft.com/sketchstudio/
Here's how it works:
- Download the plugin installer and the SDK from the download page- as of writing it's version 0.9.4:
http://www.cellosoft.com/sketchstudio/
- run the setup JTabletSetupv0.9.4.exe
- to test if the installation has worked, make sure that you close any open instance of your browser before opening
JTablet-test.html or JTablet-test2.html from the jtablet-sdk-v0.9.4/examples folder - if it works you can proceed to make use of it in Processing:
(edit)
Sorry, but the following part doesn't seem to work yet, looks like I tricked myself:
(/edit)- create a new folder named "jtablet" or "cello" inside your processing-0085/libraries folder anb copy the file jtablet.jar into it. You'll find that in the jtablet-sdk-v0.9.4/dist folder. (edit)
Currently you still have to do it the old-school way:
(/edit)- add a folder name "code" to your sketch's folder and copy the jtablet.jar into it - that's how it will work.
- start processing, create a new sketch and paste the following example code:
Code:
import cello.tablet.*;
JTabletCursor cursor;
JTablet tablet;
void setup(){
try {
tablet = new JTablet();
} catch (JTabletException jte) {
System.err.println("Could not load JTablet! (" + jte.toString() + ").");
}
}
void draw(){
try {
tablet.poll();
} catch (JTabletException jte) {
System.err.println("Could not poll JTablet! (" + jte.toString() + ").");
}
if (tablet.hasCursor()) {
JTabletCursor cursor = tablet.getCursor();
println(cursor.getData(JTabletCursor.DATA_X)+"/"+cursor.getData(JTabletCursor.DATA_Y)+"/"+cursor.getData(JTabletCursor.DATA_PRESSURE ));
}
}
That's all for a simple start. For all the additional functions like getting tilt, orientation, pitch, roll (whatever your tablet supports) check the API docs in docs\index.html