Reputation: 681
I am using Scene Kit and have created an SCNBox. On the front face of the box I want it so "A" happens if the left side of the front face gets clicked, and "B" happens if the right side of the front face gets clicked. How can I achieve this. I checked on stack but most answers cover if a node gets touched, not part of a node.
Upvotes: 3
Views: 848
Reputation: 13462
SCNHitTestResult
has a geometryIndex
that will give you the index of the geometry element that was hit (i.e. the cube face). It also has a faceIndex
property that will give you the index of the primitive in this element.
Upvotes: 6