Hi all,
I have developped 3D constellation with opengl. I want to access by mouse clicking on one point the Cordinates (x,y,z)
and can't access to points cordinates .
I try to use the following fonctions but it doesn't work:
float x = event.getX();
float y = event.getY();
static private int[][] position = {
{0, 0, 0},
{-one, -one, -one},
{one, -one, -one},
{one, one, -one},
{-one, one, -one},
{-one, -one, one},
{one, -one, one},
{one, one, one},
{-one, one, one},
};
private void Get_cord(float x, float y) {
float x1,y1,z1;
double DELTA = 0.5;
moveTo=NULL;
int a=0;
for (int p=0 ; p<position.length ; p++){
while (a==0){
x1 = position [p][0];
y1 = position [p][1];
z1 = position [p][2];
if (Math.abs((x1*x1+ y1*y1)-(x*x+ y*y))<=DELTA){
X=x1;
Y=y1;
Z=z1;
moveTo=ROT;
a=1;
}
}
}
}
Please can anybody help me?


