Determine which side of SCNBox got touched, Scene Kit ios

﹥>﹥吖頭↗ 提交于 2019-12-22 11:24:19

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/36070840/determine-which-side-of-scnbox-got-touched-scene-kit-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!