another request/suggestion -- is there a reason that methods that involve moving/rotating along camera vectors (truck, boom, dolly, tilt, pan, roll) are cumulative/relative rather than absolute?
for example, roll() does not roll the camera TO an angle specified by the parameter, but BY that angle. so in order to rotate TO a specified angle, you have to calculate the difference and plug that in.
that makes it difficult to code eased animation. for example, easing a graphic element in processing would work like this:
Code:
float x = 0;
float tgtX = 100;
float speed = .05f;
void setup () {
size(200, 200, P3D);
}
void draw () {
background(0);
x += (tgtX - x) * speed;
rect(x, 50, 50, 50);
}
however, if i want to ease a camera roll, say from 0 to HALF_PI, i have to do this:
Code:
import damkjer.ocd.*;
Camera cam;
float rollVal = 0;
float tgtRV = HALF_PI;
float speed = .05f;
void setup () {
size(200, 200, P3D);
cam = new Camera(this, width/2, height/2, (height/2)*sqrt(3), width/2, height/2, 0); //default processing view
}
void draw () {
background(0);
rect(0, 50, 50, 50);
float dRV = (tgtRV-rollVal) * speed;
rollVal += dRV;
cam.roll(dRV); //use delta, instead of new value (as in ease example above)
cam.feed();
}
the current setup works, but it doesn't seem quite in-line with the rest of processing. just something to consider...
-d