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 › Help with video library (MovieMaker) required
Page Index Toggle Pages: 1
Help with video library (MovieMaker) required (Read 221 times)
Help with video library (MovieMaker) required
Mar 25th, 2008, 11:15am
 
Hi,

I have written a drawing program which runs in an endless loop and captures a series of images from the program. This works fine.  I have attempted to use the the MovieMaker class within the video library, in order to capture a .mov file of this process, to no avail.

The code below works correctly. the additional MovieMaker class related code has been commented out (using // and /* */) Removing the comments to implement this extra code results in the program not running at all. I would most appreciative of any help with this!

thanks in advance.

------------------------------------------------------

//import processing.video.*;


float a =0.0;  
float b =0.0;  
float c =15.0;  
float d =15.0;  
float e =1000;  
float f =0;  
float g = -15;  
float h = 15;  
float i =1000;  
float j =1000;  
float k =-15;  
float l= -15;  
float m= 0;  
float n= 1000;  
float o = 15;  
float p = -15;  
float s= 255;  
float x=10;  
float v=0;  
float w=10;  
float z=5;  
float y=10;  
int imCount=1000;

float speed = 1;  
float direction = 3;  
float speed_s=1;  
float direction_s=10;  
float speed_v=1.0;  
float direction_v=10;  
float direction_w=20;  
float direction_z=10;  


//MovieMaker mm;


void setup(){  
 

 size (1000,1000);  
/* mm = new MovieMaker(this, width, height, "drawing.mov",30, MovieMaker.H263,MovieMaker.HIGH);*/
                       

 background(0);  
}  

void draw(){  
  String fileName="image-"+imCount;
 stroke (v);  

 strokeWeight(1) ;  

 fill(255);  
 


 rect (a,b+z,c,d+w);  
 rect (e,f+z,g,h+w);  
 rect (i,j-z,k,l-w);  
 rect (m,n-z,o,p-w);

  rect (a,b+z,c,d);  
 rect (e,f+z,g,h);  
 rect (i,j-z,k,l);  
 rect (m,n-z,o,p);  
 


rect (a+z,b,c+w,d);  
rect (e+z,f,g+w,h);  
rect (i-z,j,k-w,l);  
rect (m-z,n,o-w,p);

 rect (a+z,b,c,d);  
rect (e+z,f,g,h);  
rect (i-z,j,k,l);  
rect (m-z,n,o,p);

//mm.addFrame();  





if (random(1)<0.8) {direction_w=-direction_w;}
if (random(1)<0.025){direction_z=-direction_z;}

 a=a+(speed*direction);  
 b=b+(speed*direction);  
 e=e-(speed*direction);  
 f=f+(speed*direction);  
 i=i-(speed*direction);  
 j=j-(speed*direction);  
 m=m+(speed*direction);  
 n=n-(speed*direction);  
 s=s-(speed_s*direction_s);  
 v=v+(speed_v*direction_v);  
 w=w+(speed*1*direction_w);  
 z=z+(speed*1*direction_z);  
 
 if (w<-0||w>500){  
   w=0;  
 }  
 if (z<-0||z>1000){  
    z=0;
 }  

 if (v<0||v>250){  
   direction_v=(direction_v*-1);  
 }  

 if (s<0){  
   direction_s=-abs(direction_s);  
 }  
 else if (s>255){  
   direction_s=abs(direction_s);  
 }  
  if (a>500){  
   direction = (direction*-1);  
   c=c-x;  
   d=d-x;  
   g=g+x;  
   h=h-x;  
   k=k+x;  
   l=l+x;  
   o=o-x;  
   p=p+x;  
 }  
   if (a<-100){  
   direction = (direction*-1);  
   c=c+x;  
   d=d+x;  
   g=g-x;  
   h=h+x;  
   k=k-x;  
   l=l-x;  
   o=o+x;  
   p=p-x;
  ++ imCount;
   save(fileName + ".tga");  
 }
  }

/*void keyPressed() {
 if (key == ' ') {
   mm.finish();  // Finish the movie if space bar is pressed!
 }
}
*/



Page Index Toggle Pages: 1