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 running Warpaint2
Page Index Toggle Pages: 1
help running Warpaint2 (Read 915 times)
help running Warpaint2
Aug 17th, 2007, 5:41pm
 
There's a very nice program call Warpaint2.  A simulation and the source codes can be found at http://www.blprnt.com/processing/warpaint/
Running the code results in a single error message and it relates to a file "explosion.gif".  The file is not provided.  However, I must be missing something as I don't understand the overall function of the file within the code.  

Any help would be appreciated

Marc
Re: help running Warpaint2
Reply #1 - Aug 17th, 2007, 7:03pm
 
from the code:

"//Get the colour pallette from an image.
This script is from Jared Tarbell (complexification.net).
takecolor("explosion.gif");"

so i guess any old image will do - it only supplies the colours and is never displayed itself.

andy
Re: help running Warpaint2
Reply #2 - Aug 17th, 2007, 7:15pm
 
Hi Andy

We've tried that with multiple gifs with no success.

M
Re: help running Warpaint2
Reply #3 - Aug 20th, 2007, 11:50am
 
sorry for delay.

works for me using a 4x1 gif (the smaller the better) of red, orange and yellow. looks a bit odd in that it has a lot of black in it (which isn't in the gif) but is otherwise ok.

old versions of java didn't support certain graphical file types, maybe that's it.

(ok, explosion.gif is in the jar file included in the html, is here if you want it: http://www.koogy.clara.co.uk/explosion.gif )
Re: help running Warpaint2
Reply #4 - Aug 20th, 2007, 6:19pm
 
Hi Andy

Thanks for the gif and advice.  Seems like I found the source of the problem but not the solution.  Processing simulations work fine on my Mac - except for this one.  When I run Warpaint on a PC it runs. So for know that's it - any advice on getting it to run on my Mac

Thanks  again

M
Re: help running Warpaint2
Reply #5 - Aug 20th, 2007, 7:07pm
 
http://www.ubuntu.com/ 8)

is it the gif that's the problem? code should work with any other graphic file, like a png. just keep them small because the code to extract the colours gets every pixel in turn (and does a linear search through the already seen colours to see if the new one is a duplicate, yikes.)

failing that, create your own colour array. just change color_picker.pde to fill goodcolor array and numpal with your own values.
Re: help running Warpaint2
Reply #6 - Aug 21st, 2007, 3:14pm
 
Hi Andy

Took your advice on all counts.  Still no luck.  We used the code on a fast and slow PC - both yielded good animation.  We did the same on our fastest Mac - the graphics rendering is so slow as to be almost imperceptible (1: with a tiny gif, and, 2: with a supplied color scheme).  I believe it's somehow related to the way Macs handles Java code, but...

Marc
Re: help running Warpaint2
Reply #7 - Aug 21st, 2007, 4:19pm
 
in the tab for Transparent_Point, replace the stroke & point lines with:

set(x1, y1, nc);

which is many times faster than point(). apparently the difference is even more considerable on apple's poorly optimized java.

also, put size(600, 600) at the beginning of setup(), and remove the later size(w, h) line. variables *should not be used* with size(), and size() must be the first thing setup.
Re: help running Warpaint2
Reply #8 - Aug 21st, 2007, 9:05pm
 
Andy and Ben

Thanks very much.  The order of the universe is restored - and more importantly, the code works.  I appreciate the patience.

Marc

Page Index Toggle Pages: 1