Here is an example of a 
simple tween that follows a 3d path. 
Library: 
http://www.ekeneijeoma.com/processing/tween Code:/**
  Title: simple 3d tween
  
  Author: Bloom
  Date: january 2010    
  Description: An object follows a simple path
*/
import processing.opengl.*;
import ijeoma.tween.*;
import ijeoma.easing.*;
//∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
Thing obj;
//path coords
int i = 100;
int[][] path = {{i, i, i},{-i, -i, -i}};
TweenGroup tweenGroup;
//∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
void setup(){
  size(400, 400, OPENGL);
      
  obj = new Thing();  
  
  Tween tx = new Tween(this, "tweenX", obj, "object", path[0][0], path[1][0], 70f, Tween.FRAMES, 0f, Tween.LINEAR_EASE_IN);
  Tween ty = new Tween(this, "tweenY", obj, "object", path[0][1], path[1][1], 70f, Tween.FRAMES, 0, Tween.LINEAR_EASE_IN);
  Tween tz = new Tween(this, "tweenZ", obj, "object", path[0][2], path[1][2], 70f, Tween.FRAMES, 0f, Tween.LINEAR_EASE_IN);
  
  tweenGroup = new TweenGroup(this, "tweenGroupXYZ", new Object[]{tx, ty, tz});  
  tweenGroup.repeat(Tween.REVERSE); //palindrome fx
  tweenGroup.start();
  
}
void draw() {
  background(255);
  
  translate(width/2, height/2, 0);  
  rotateX(frameCount/100.0);         
  rotateY(2.0);
  rotateZ(frameCount/200.0);
    
  //simple guide..  
  noFill();
  stroke(200);
  box(i*2);
  
  //path
  noFill();
  stroke(0);  
  beginShape();
  vertex(path[0][0], path[0][1], path[0][2]);
  vertex(path[1][0], path[1][1], path[1][2]);
  endShape(CLOSE);  
    
  //tween object  
  tweenGroup.update();    
  Tween tx = tweenGroup.getTweenByName("tweenX");
  Tween ty = tweenGroup.getTweenByName("tweenY");  
  Tween tz = tweenGroup.getTweenByName("tweenZ");   
  obj.draw(tx.getPosition(), ty.getPosition(), tz.getPosition());
    
}
//∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
class Thing{
  
  Thing(){}
  
  void draw(float _x, float _y, float _z){
    fill(0);
    translate(_x, _y, _z);
    box(20);
  }
  
}