ssue to access points cordinates in a 3D constellation

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

ssue to access points cordinates in a 3D constellation

Postby Galsen » Fri Feb 13, 2009 11:01 am

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?
Attachments
constellation 3D.gif
(233.24 KiB) Downloaded 107 times
Galsen
Toulouse, France
Galsen
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Feb 10, 2009 11:21 am
Location: France

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests