Author Topic: How to get the normal vector by touching the screen?  (Read 1730 times)

Offline Zhangzqs

  • byte
  • *
  • Posts: 2
    • View Profile
How to get the normal vector by touching the screen?
« 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: How to get the normal vector by touching the screen?
« Reply #1 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), 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.