We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › Interfacing Tablets (continued from old forum)
Page Index Toggle Pages: 1
Interfacing Tablets (continued from old forum) (Read 3552 times)
Interfacing Tablets (continued from old forum)
Apr 21st, 2005, 2:10pm
 
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


Re: Interfacing Tablets (continued from old forum)
Reply #1 - Apr 21st, 2005, 4:40pm
 
Anyone want to buy me one of these and an intuos3 so I can get rotation working in JTablet Wink

Couple notes on your code, you might want to check that tablet is not null in your draw loop, in that case that it didn't initialize you won't get an error.  It may also be useful to check the return value of poll and to the println inside that try block instead.

Would people like to see a Processing-specific wrapper library for JTablet  I believe it could do some things, such as catching exceptions and polling automatically to make it more friendly for non-java coders.

Marcello

p.s. please don't link directly to the files.cellosoft.com server, just link to the sketchstudio site since it will have the latest links/mirrors.
Re: Interfacing Tablets (continued from old forum)
Reply #2 - Apr 21st, 2005, 5:35pm
 
Thanks for the corrections Marcello.

Maybe you also have a hint how to get the coordinates correct in processing - I have the problem that they do not seem to be the same as mouseX/mouseY - actually Y is upside-down. Currently as a workaround I'm only using the pressure information and take the x/y from mouseX/mouseY.
Re: Interfacing Tablets (continued from old forum)
Reply #3 - Apr 22nd, 2005, 3:47am
 
The X/Y information by JTablet is exactly what wintab gives me, unaltered, I'm not super up on what exactly it is, but I'd assume it's measured from the bottom left of the tablet.  It is really only useful for when you don't want to use the tablet as a mouse but more of an input device, so yes, using mouseX and mouseY as you are doing is actually recommended.

Marcello
Re: Interfacing Tablets (continued from old forum)
Reply #4 - Jul 28th, 2005, 1:02pm
 
Has there been any movement on using tablets on the MAC I could really do with reading the pen's pressure.

Seems to be a bit of an issue.
Re: Interfacing Tablets (continued from old forum)
Reply #5 - Jul 28th, 2005, 3:25pm
 
Someone had started working on a mac port of JTablet, but he seems to have stopped.  I'm not sure if he has any code worth looking at or continuing, but I could try to find out if there are any Mac coders here.

Marcello
Re: Interfacing Tablets (continued from old forum)
Reply #6 - Jul 28th, 2005, 3:38pm
 
The only thing I've come across is something called jwacom, but it's only for Linux.

Tablet currently sits on floor looking very redundant for something less than 5 hours old! Bugger! I only want the tablet for processing, no other use for it.

appreciate it Marcello.
Re: Interfacing Tablets (continued from old forum)
Reply #7 - Aug 15th, 2005, 12:23am
 

I'm still looking to get hold of the pen-pressure on OSX, does anyone have anything on this yet?

Re: Interfacing Tablets (continued from old forum)
Reply #8 - Oct 24th, 2005, 5:30pm
 

Sorry, but I wanted to revitalize this in the vain hope that someone has any ideas on OSX pen pressure!

Well...?
Re: Interfacing Tablets (continued from old forum)
Reply #9 - Oct 25th, 2005, 11:41pm
 
Everything you need is here:
http://www.allegro.cc/forums/view_thread.php_id=534846

I just don't have a mac to do it myself.  If someone wants to donate one, I will gladly port JTablet to Mac.

Marcello
Page Index Toggle Pages: 1