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 checkout the latest revision with subversion from the repository with:

svn co http://svn.infostuka.org/rep/libTablet/trunk/

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

CC - Some rights reserved

Copyright © Marcus Wendt 2008
This library is licensed under the GNU LGPL

 

Permalink

 

spherical linear interpolation on a circle

marcus • March 3rd, 2008

how to do a slerp with angles?
that caused me some headache this morning. however, the solution is blatantly simple.
» example sketch

1
2
3
4
5
6
7
8
9
10

float angleSlerp(float cur, float to, float delta)
{
  if(cur < -HALF_PI && to > HALF_PI) {
    cur += TWO_PI;
  } else if(cur > HALF_PI && to < -HALF_PI) {  
    cur -= TWO_PI;
  }
  return cur * (1-delta) + to*delta;
}

eclipse europa

marcus • August 11th, 2007

this is probably a few days old news but anyway … the eclipse foundation’s europa packages are officially released. download here!

Eclipse Europa is the annual release of Eclipse projects. Like last year’s Callisto release, the Europa release is a coordinated release of different Eclipse project teams. This year, the annual release includes 21 projects. By releasing these projects at the same time, the goal is to eliminate uncertainty about version compatibility and make it easier to incorporate multiple projects into your environment.

i was pleasantly surprised to discover the new dynamic languages toolkit project that is included in the default java distribution. a good reason to have another go at my jruby experiments soon. (after some initial success with writing opengl processing sketches in ruby i gave up this idea since the lack of IDE integration was just too annoying…)

Collada Export Plugin for Processing

marcus • August 8th, 2007

libCollada allows you to easily export 3D geometry and material data in the COLLADA 1.4.1 format from your processing applications. Although processing’s drawing methods and COLLADA’s scenegraph based, more complex 3D description format, do not match directly – the library attempts to do a reasonable conversion, requiring no extra API to learn.

Releases

version 0.2

now creates materials & effects generated from standard p5 drawing commands
» collada-0.2.zip

version 0.1

first public release with examples and packaged for p5
» collada-0.1.zip

version 0.01 (08/06/07)

a first rather rough version that can export basic geometry data.

Source

You can checkout the latest revision with subversion from the repository with:

svn export http://svn.infostuka.org/rep/libCollada/trunk/

Useage

Use the plugin in the same way as you would with the PDF or PNG exporter.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import processing.opengl.*;
import infostuka.collada.p5.*;

void setup() {
  size(400, 400, OPENGL);
}


void keyPressed() {
  if (key == ' ') {
    record = true;
  }
}


void draw ()
{
    if (record) {
        beginRecord(P5ColladaExport.DAE, "output.dae");
    }

    // ... your drawing operations here ...

    if (record) {
        endRecord();
        record = false;
    }
}

Examples


Related

License

CC - Some rights reserved

Copyright © Marcus Wendt 2007
This library is licensed under the GNU LGPL

 

Permalink

 

3d 4-space abstract aesthetic system aesthetics algorithm alien ambient ambisonics animation architecture art artificial audio audio research black&white book caskets classic clicks & cuts climate code color competition computer-vision conceptual art consoles cpp culture ddr design devices digtial fabrication documenta documentation drawing dynamics electricity electromagnetism electronics environment event exhibition experimental exploration fashion festival film flocking folk food fractal furniture gamedev generative genetic geometry glitch graphic hacks haptics hardware history hyperspace ideas illustration images inspiration installation instrument intelligence interactive interieur japan java knowledge management landscape library life light liquid live london math micro minimal minimalism modernism monochrome motion motion graphics multiples music naming nature nervous ink networked networking opensource osx painting paper particles performance personal photography physics playful politics press print processing processing.org programming quotes recipes research retro romance ruby science scripts sculpture SENDUNG.net shopping snippets social software sound space space exploration craft space exploration craft orbiter supercollider swiss systems technology theory theremin toys transformed travel tricks typography universe video visual vj water web2.0 xcode