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 & HelpPrograms › Camera moving with a curve
Page Index Toggle Pages: 1
Camera moving with a curve (Read 464 times)
Camera moving with a curve
Oct 30th, 2009, 7:44am
 
Hi,

I am new to processing and I find it great.

I am trying to write a program that plots a given 2d trajectory (x,y) and I want the camera to move with the curve (I want the camera to focus on the point being actually plotted while still displaying some of the preceding points).

I am trying to do it with the ocd package but I am stuck
Thanks,

Mohamed
--------------------------------------------------
This is a simplified version of "draw" code

void draw(){
 Trajectory trajectory = new Trajectory("positions.txt",this);
 camera1.feed();
 stroke(255);
 point((trajectory.x)[index-1],(trajectory.y)[index-1]);
 camera1.aim((trajectory.x)[index],(trajectory_smoothed.y[index],100);

}
Page Index Toggle Pages: 1