TouchEvent getX getY

I have the following problem.After implemented TouchListener, I want to select a Geometry with a single touch on the screen, and then, rotate the Geometry using TouchEvent parameter (getX() and getY() methods). Is it possible?

Thanks in advance


you’ve got a nice binary rating going there @normen :slight_smile:

1 Like

Thanks for your response, do you have a simple code example?

Look at HelloPicking in the tutorials

then instead of initializing your ray with the cam direction use the coordinates of the tap


Vector2f coord = new Vector2f(event.getX(),event.getY());

Vector3f origin = cam.getWorldCoordinates(coord, 0.0f);

Vector3f direction = cam.getWorldCoordinates(coord, 0.3f);


Ray ray = new Ray(origin, direction);


ok perfect, thank you