Hi Vincent!
I'm going to comment your script below. I think to use a while(running)
loop isn't a good idea ... the console can't come up. I introduced the
TriggerController for thinks like that. Look in the cynosure.js.
trigger = new TriggerController();
register_controller(trigger);
trigger.frame = function() {
// do stuff
Draw();
};
This will be get a set_fps() too.
MrGoil
Vincent.CH schrieb:
> Well, same day, other question...
>
> I'll make a little performance with Freej in June , in south of France,
> provence, during a festival , then i try to script some nice things ...
> In the script below, i randomize the parameters values for Distort0r
> effect filter
> For those who are not aware, i'm a kind of newbie in js
> But i like the effect made by this code on my image, except one
> thing...: It goes really too fast !!, i'd love it to change parameters
> values slower than this , it wd be smoother , nicer (to me).
> So , if any of you can comment it, show me the direction...or another
> way ...((o:
> Damn , it's not so easy to understand how to insert some time parameters
> in JS!
> Vincent
>
> // freej 0.9.1
> //bad script for randomize parameters effect
> //on an image
>
> set_resolution(800,600);
>
> ima = new ImageLayer()
> ima.open("/path/to/image/o.jpg");
> effa = new Filter("Distort0r");
> add_layer(ima);
> ima.add_filter(effa);
>
> running = true;
> kbd = new KeyboardController();
> register_controller( kbd );
> kbd.released_esc = function() { running = false; }
> kbd.pressed_esc = function() {quit();}
>
> function randomize_eff(effa) {
> var a, f;
> a = rand() % 50;
> f = rand() % 50;
>
> if(a<0) a = -a;
> if(f<0) f = -f;
>
Mh, how about abs():
a=Math.abs(rand() % 50 ); // range 0-50
or
f = Math.round(Math.random() * 50);
> effa.set_parameter("Amplitude",a/100);
> effa.set_parameter("Frequency",f/10);
actually I don't know which is the best value range. But looking into
the source I see a hack that Frequency is *200
Also this reminds me fixing the time parameter for frei0r ... testing
this script with my branch that filter makes freej mad.
>
> }
> while(running) {
>
> randomize_eff(effa);
>
>
> run(1);
>
> }
> //quit();
>
>
>
> _______________________________________________
> Freej mailing list
> Freej@???
> http://lists.dyne.org/cgi-bin/mailman/listinfo/freej