📅  最后修改于: 2022-03-11 15:01:02.783000             🧑  作者: Mango
func transformToTextureCoordinates(screenCoordinates: CGPoint) -> CGPoint {
let hitTestResults = sceneView.hitTest(screenCoordinates, options: nil)
guard let result = hitTestResults.first else {
return CGPoint(x: -1, y: -1)
}
let textureCoordinates = result.textureCoordinates(withMappingChannel: 0)
return CGPoint(x: textureCoordinates.x * textureImage.size.width, y: textureCoordinates.y * textureImage.size.height)
}