How to get the normal vector by touching the screen?

Started by Zhangzqs, July 16, 2018, 08:56:36 AM

Previous topic - Next topic

Zhangzqs

I clicked on the screen and calcMinDistanceAndObject3D can determine which 3d object I clicked on, but how do I determine the polygon data I clicked? How to find the coordinates and normal vectors of the clicked polygon.

EgonOlsen

You can attach a CollisionListener to the object (http://www.jpct.net/doc/com/threed/jpct/CollisionListener.html), make it return true in its requiresPolygonIDs() implementation and use the data returned by the collision event in combination with the http://www.jpct.net/doc/com/threed/jpct/PolygonManager.html. That should give you the desired data.