Loading...
Logo
Processing Forum
Hello, I wonder whether you could help me with my issue?

I'm using the 'balls' example from 'http://www.learningprocessing.com/' :
http://www.learningprocessing.com/examples/chapter-10/example-10-2/

With oscP5 I receive 'integers' from SuperCollider. These values should be used to change the radial (size) of the balls made with the class. Now, I am struggling to do find a solution...

How could I do that?

And also how to I change an integer (received from SC) into a float (that is used in the class).

Any help appreciated, all the best, K

Replies(1)

.... sorted, took a while. Sorry, this is probably very basic...

just for the reference:

1) I've changed this in the class:

  void display(int rad) {
    r = rad;
    stroke(0);
    fill(0,50);
    ellipse(x,y,r*2,r*2);
   
  }

2) and this in the 'scratch' :

  ball1.move();
  ball2.move();
  ball1.display(fromSc[0]);
  ball2.display(fromSc[1]);

the vars 'fromSC[0], ... are received with oscP5.

all the best, K