www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Zhangzqs on July 16, 2018, 08:56:36 am

Title: How to get the normal vector by touching the screen?
Post by: Zhangzqs on July 16, 2018, 08:56:36 am
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.
Title: Re: How to get the normal vector by touching the screen?
Post by: EgonOlsen on July 16, 2018, 11:17:39 am
You can attach a CollisionListener to the object (http://www.jpct.net/doc/com/threed/jpct/CollisionListener.html (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 (http://www.jpct.net/doc/com/threed/jpct/PolygonManager.html). That should give you the desired data.