FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   How to animate a large JPG efficiently?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: How to animate a large JPG efficiently?  (Read 1058 times)
thomasmann


How to animate a large JPG efficiently?
« on: Feb 8th, 2005, 3:31pm »

Hello everyone, i am new to processing but am trying to make an animation by moving a long thin JPG image across the screen while playing an audio file. i looked through the web site and searched the forums, but could not really find an answer.
 
i know that this is not what processing is built for, and i believe what i read on these forums that director and flash are good for drawing and processing is good for processing, but i would love to pursue this just as a little exercise.
 
thank you.
 
TomC

WWW
Re: How to animate a large JPG efficiently?
« Reply #1 on: Feb 8th, 2005, 6:51pm »

Audio isn't that great on Processing at the moment.  You'll need to look at the Sonia library.
 
To move a jpg, there are lots of resources you could try.  Look up the examples/reference for the loadImage() and image() functions and the BImage class to get you started.
 
thomasmann


Re: How to animate a large JPG efficiently?
« Reply #2 on: Feb 9th, 2005, 1:56pm »

Thanks TomC, i'll take a look at those and report!
 
(tm)
 
thomasmann


Re: How to animate a large JPG efficiently?
« Reply #3 on: Feb 9th, 2005, 2:19pm »

I've hit a bit of a wall TomC, I read all of the tech notes you directed me to, and they were great, and I was able to implement each of them in my app, but I was unable to use them to animate the image (simply have it moving accross the screen).  
 
I also couldn't find an example in the exhibitions section. I think what I'm trying to do is just so simple, but I just can't crack it!
 
thomasmann


Re: How to animate a large JPG efficiently?
« Reply #4 on: Feb 9th, 2005, 4:45pm »

I was looking at the examples again, and i was taking a look at the 'motion: linear' ( http://processing.org/learning/examples/linear.html ) and now I am trying desperatley to subsitute the vector line with a JPEG, and let the JPEG (which is larger than the stage) keep moving upwards.  
 
Am I barking up the wrong tree?
 
I really gotta sort this out, help me I'm drowning!!
« Last Edit: Feb 9th, 2005, 4:46pm by thomasmann »  
Quasimondo

WWW Email
Re: How to animate a large JPG efficiently?
« Reply #5 on: Feb 9th, 2005, 5:33pm »

I think the image() function should work in your case:
 
http://processing.org/reference/image_.html
 
Simply animate the x,y of the upper corner.
 

Mario Klingemann | Quasimondo | Incubator | côdeazur
thomasmann


Re: How to animate a large JPG efficiently?
« Reply #6 on: Feb 9th, 2005, 5:38pm »

Thanks Quasimondo,  
 
would you be able to point me in the way of another example where I can see the animating technique (through changing the X Y values) you are talking about? Thanks heaps again!
 
(tm)
« Last Edit: Feb 9th, 2005, 5:38pm by thomasmann »  
Quasimondo

WWW Email
Re: How to animate a large JPG efficiently?
« Reply #7 on: Feb 10th, 2005, 11:28am »

-------------------------------
 
BImage img;
 
void setup(){
size(200, 200);
  img = loadImage("http://iwin.nws.noaa.gov/iwin/images/ecir.jpg");
}
 
void loop(){
  background(0);
  image(img, mouseX, mouseY);
}
 
-------------------------------
 
 
BImage img;
int top;
 
void setup(){
size(200, 200);
top=0;
  img = loadImage("http://iwin.nws.noaa.gov/iwin/images/ecir.jpg");
}
 
void loop(){
  background(0);
  image(img, 0, top);
top=(top+1)%height;
}
 
 
 

Mario Klingemann | Quasimondo | Incubator | côdeazur
Pages: 1 

« Previous topic | Next topic »