Hello, I'm having trouble with a project, create some ellipses in it, from within the values of X and Y positions of these frequencies is created for the Pure Data sound generation. I'm trying to get the position of these ellipses from the moment they click until the soil, but without success.
-----------------------------
import pphys2d.bodies.*;
import pphys2d.joints.*;
import pphys2d.shapes.*;
import pphys2d.phys2d.raw.collide.*;
import pphys2d.phys2d.raw.strategies.*;
import pphys2d.phys2d.raw.forcesource.*;
import pphys2d.phys2d.util.*;
import pphys2d.phys2d.raw.shapes.*;
import pphys2d.*;
import pphys2d.phys2d.raw.*;
import pphys2d.phys2d.math.*;
import java.awt.Color;
import oscP5.*;
import netP5.*;
//criar um tipo de conexão OSC
OscP5 meuOsc;
//criar uma conexão remota para envio de dados OSC
NetAddress meuEndereco;
//----------------------------------
PFont fonte;
int posx, posy;
int laco;
int posobjetoX[] = new int[12];
int posobjetoY[] = new int[12];
float NewposobjetoX[] = new float[12];
float NewposobjetoY[] = new float[12];
int targetX = 420;
int targetY = 420;
//criando o mundo PPhys2D
PPWorld mundo = new PPWorld();
//criando circulo
PPCircle[] circulo = new PPCircle[12];
PPBox caixa = new PPBox(150,150);
void setup() {
//setando o frame rate
frameRate(30);
//dimensao da tela
size(500,500);
fonte = loadFont("ArialMT-16.vlw");
//configurando definicoes do mundo
mundo.setGravity(0,1000);
mundo.setEdges(this, new Color (#E800FA));
//setando friccao aos espacos laterais do mundo
mundo.setEdgesFriction(10);
//configurando circulo
smooth();
//configurando caixa
smooth();
noStroke();
caixa.setFillColor( new Color (#001B2C));
caixa.setMass(2000);
/*---------------------------------------*/
//iniciando conexão osc na porta 3000
meuOsc = new OscP5(this,3001);
//iniciar conexão remota com o dominio na porta 3000
meuEndereco = new NetAddress("127.0.0.1",3001);
}
void draw() {
//cor fundo
background(255);
mundo.draw(this);
}
void mouseClicked() {
if( laco<=12 ) {
laco=laco+1;
posobjetoX[laco] = mouseX;
posobjetoY[laco] = mouseY;
circulo[laco] = new PPCircle(20);
circulo[laco].setFillColor(new Color (#00F4FA));
//adicionando massa ao circulo
circulo[laco].setMass(1000);
//adicionando Damping, efeito do ar sobre o circulo