|
Author |
Topic: help needed - useless irishman!! (Read 367 times) |
|
fenerbachephil
|
help needed - useless irishman!!
« on: Feb 14th, 2005, 4:22pm » |
|
hi everybody! just started with processing this week but i could use a big hand! im currently doing my honours project for university and hopefully processing can play a big part. main problem is im sh*t at programming and coding and working to a tight schedule! basically does anyone know how this program could be achieved? -video to play through -video to fade if mouse (or button) isnt clicked before 'x' seconds, repeatedly....eg. button has to be pressed between 1 and 4 secs or else on the 5th sec video fades...ie video doesnt fade if button pressed every 4 seconds -image and/or sound bite appears if video hasnt faded once after 1 min...then continues to appear every 20 secs after that if anyone has an idea what the program would look like, or even just a few pointers id be soooo grateful!!! Cheers, Phil
|
|
|
|
st33d
|
Re: help needed - useless irishman!!
« Reply #1 on: Feb 15th, 2005, 4:47pm » |
|
Code: boolean newFrame = false; int frameC = 0; int framesPerSecond = 4; int xsecs = 2; int fadePower = 0; int jam = 0; void setup() { size(320, 240); /* //required for different video sources try{ quicktime.QTSession.open(); quicktime.std.sg.SequenceGrabber sg = new quicktime.std.sg.SequenceGrabber(); quicktime.std.sg.SGVideoChannel sc = new quicktime.std.sg.SGVideoChannel(sg); quicktime.std.sg.VideoDigitizer vd = sc.getDigitizerComponent(); vd.setInput(2); } catch (Exception e) { e.printStackTrace(); } */ beginVideo(width, height, framesPerSecond); } void videoEvent() { newFrame = true; } void loop() { if(newFrame) { background(video); Fade(fadePower); newFrame = false; frameC++; } if ( frameC > xsecs*framesPerSecond){ fadePower++; } if (mousePressed){ frameC = 0; fadePower = 0; jam++; } } void Fade(int strenght){ fill(jam,0,0,strenght); rect(0,0,width,height); } |
| Something like that. I haven't put the image drop in for you. You can probably figure it out yourself from the frame-counting system.
|
I could murder a pint.
|
|
|
|