Easier azimuth and altitude access in proTablet   Leave a comment

ProTablet is a Processing library, based on JPen, that I wrote a while a to simplify the access to the graphics tablet. Earlier versions of proTablet allowed to grab the pen’s X azimuth and altitude values with the getAzimuthXAndAltitude() method. Look at this code for instance:

float[] azimuthAltitude = new float[2];
tablet.getAzimuthXAndAltitude(azimuthAltitude);
float angle = (azimuthAltitude[0]*-1);
float penLenght = cos(azimuthAltitude[1])*150;
float pressure = tablet.getPressure();

However, this approach is a little bit cumbersome since it requires creating an array to hold the azimuth and altitude values calculated by getAzimuthXAndAltitude(). Benedikt GroƟ added a couple of new methods in order to simplify the access to these values: getAzimuth() and getAltitude(). The new release of proTablet (0.6) includes these methods as well as an up-to-date version of JPen (090216).

About these ads

Posted February 20, 2009 by ac in Programming

Tagged with , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 61 other followers

%d bloggers like this: