Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

swift arkit texture face get position on screen

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)
}
Comment

PREVIOUS NEXT
Code Example
Swift :: swift array in chunks 
Swift :: send receive udp swift 
Swift :: repeat...while Loop Swift 
Swift :: swift from 1 to 01 
Swift :: Swift Change Value of a Variable 
Swift :: Customize indicator view iOS swift 
Swift :: swiftui divider remove padding 
Swift :: how to multiply numbers in array swift 
Swift :: To get IPAddress for wifi , wired, and cellular 
Swift :: swift variables 
Swift :: Swift static Property 
Swift :: Swift Optional Binding (if-let 
Swift :: swift memberwise initializer 
Swift :: continue keyword in swift language 
Swift :: swift weekday date component values 
Swift :: swift api call certificate 
Swift :: Assign values to enum variables Swift 
Swift :: swift truncate a float 
Swift :: swiftui orientation failed after change orientation popup 
Swift :: page view controller disable swipe 
Swift :: microsoft flight simulator uses which language 
Ruby :: base64 decode ruby 
Ruby :: rails hidden field 
Ruby :: rails g resource 
Ruby :: activerecord less than 
Ruby :: ruby integer to timestamp 
Ruby :: how to destroy a migration in rails 
Ruby :: date time string to time in rails 
Ruby :: ruby iterate hash with index 
Ruby :: check type in ruby 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =