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 & HelpSyntax Questions › SuperHero revised
Page Index Toggle Pages: 1
SuperHero revised (Read 256 times)
SuperHero revised
Mar 5th, 2009, 8:58am
 
hey guys, can anyone revise this superhero script? i am a motion graphic artist and want to use this effect on a project i am working on. any help would be greatly appreciated, and credited to the final piece. i tried to do it myself, but its  bigger than me and i need some help, deadline incoming:(

thanks in advance


http://processing.org/exhibition/works/superhero/applet/superhero_7.pde
Re: SuperHero revised
Reply #1 - Mar 5th, 2009, 6:42pm
 
There are only three spots in the code that need to be updated.  Change "BImage" to "PImage" in the two spots that it occurs, and change "framerate(40)" to "frameRate(40)"

That fixes the version incompatibilities.

The line which reads "activeContent = allContent[Integer.parseInt(getParameter("hero"))];" doesn't work for me, which I take to mean that this script is intended to work in a mode where it's being run with explicit command line parameters (e.g. "-hero=3" or whatever), rather than in the Processing IDE.

Hopefully that can get you started, anyway.  I rejiggered the script to work around the parameter thing, but while it runs without errors, it doesn't seem to _do_ anything.  So I dunno.
Re: SuperHero revised
Reply #2 - Mar 5th, 2009, 7:48pm
 
ya, thats the point i got to as well.  revised code, commented some stuff out...a black screen. i appreciate ya lookin at it. is there anyone that can dumb down this code to just load a single jpeg? i wish i knew how to ask for this properly, forgive my ignorance:)



Re: SuperHero revised
Reply #3 - Mar 5th, 2009, 10:22pm
 
Additional fix: I recalled having seen that loop() is the old name for draw(). Also I had to use P3D renderer (Processing emitting a warning otherwise).

I replaced Color by color and so constructor becomes: new Content(#FFFFFF, "cpt_america.jpg", 25, false); and such. So I can do just: background(bg); Not necessary but more idiomatic to modern Processing.

That's most of the changes I had to do to make it work.
Note that getParameter() is for getting an applet parameter, that's just the default hero choice.
Re: SuperHero revised
Reply #4 - Mar 5th, 2009, 11:01pm
 
o man, i(you) got it! thanks guys!
Page Index Toggle Pages: 1