use processing.js variables values in a processing/java applet?
in
Integration and Hardware
•
2 years ago
Hello,
I would like to create a webpage using *both* processing.js and processing.
The processing.js would create the visuals with some parameters (ints, floats, etc).
I need to access those values from the processing applet, which will use them to generate sounds.
By now, I'm lost with the correct way to do that...
.. should I use netscape.javascript library? JSObjects?
Maybe a small example, with an applet miming a processingjs sketch would be interesting...
...for example, how could I create a mirror of this processing.js code, by accessing the ints "a" and "b" from an applet?
// processing.js code
int a =50;
int b=50;
int w=200;
int h=200;
void setup(){
size(w,h);
}
void draw(){
background(255);
a=a+(random(-1,1))%w;
b=b+(random(-1,1))%h;
fill(0);
rect(a,b,2,2);
}
1