jPCT-AE - a 3d engine for Android > Support

How to get the normal vector by touching the screen?

(1/1)

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.

Navigation

[0] Message Index

Go to full version