2021-06-29 17:38:53 +11:00
|
|
|
|
2021-07-21 07:24:05 +11:00
|
|
|
/*
|
2021-07-23 03:34:34 +11:00
|
|
|
* dessiner par OSC
|
|
|
|
* (avec le laser de Gaby ?)
|
|
|
|
*
|
|
|
|
* nouveau Rural Art System 2021 - TerreBlanque
|
|
|
|
*
|
2021-07-21 07:24:05 +11:00
|
|
|
*/
|
|
|
|
|
2022-01-08 13:34:05 +11:00
|
|
|
9000 => int OSCPort;
|
|
|
|
32760.0 => float Amplitude;
|
2021-07-21 07:24:05 +11:00
|
|
|
|
|
|
|
OscOut xmit;
|
|
|
|
float dx, dy;
|
|
|
|
|
|
|
|
xmit.dest("localhost", OSCPort);
|
|
|
|
|
2021-07-23 23:13:56 +11:00
|
|
|
clear_the_screen();
|
2021-07-21 07:24:05 +11:00
|
|
|
|
|
|
|
for (0 => int foo; foo<25800; foo++) {
|
|
|
|
<<< foo >>>;
|
|
|
|
|
2022-01-08 13:34:05 +11:00
|
|
|
Amplitude * Math.sin(foo * 0.3001) => dx;
|
|
|
|
Amplitude * Math.cos(foo * 0.4999) => dy;
|
2021-07-21 07:24:05 +11:00
|
|
|
|
|
|
|
xmit.start("/joystick/xy");
|
|
|
|
Std.ftoi(dx) => xmit.add;
|
|
|
|
Std.ftoi(dy) => xmit.add;
|
|
|
|
xmit.send();
|
|
|
|
|
2022-01-08 13:34:05 +11:00
|
|
|
0.025::second => now;
|
2021-07-21 07:24:05 +11:00
|
|
|
}
|
|
|
|
|
2022-01-08 13:34:05 +11:00
|
|
|
// ----------------------------------------------------
|
|
|
|
|
2021-07-23 23:13:56 +11:00
|
|
|
fun void clear_the_screen()
|
|
|
|
{
|
|
|
|
xmit.start("/joystick/b");
|
|
|
|
50 => xmit.add; 1 => xmit.add;
|
|
|
|
xmit.send();
|
|
|
|
xmit.start("/joystick/b");
|
|
|
|
50 => xmit.add; 0 => xmit.add;
|
|
|
|
xmit.send();
|
|
|
|
}
|
2022-01-08 13:34:05 +11:00
|
|
|
|
|
|
|
// ----------------------------------------------------
|