Answer :

You can use the ARCamera.transform property to get the current transform of your camera. The following code is from Introducing ARKit at WWDC 2017 which you probably want to watch as an introduction. We are using the transform to place a node 10 cm in front of the camera.

In Swift:

var translation = matrix_identity_float4x4 translation.columns.3.z = -0.1 // Translate 10 cm in front of the camera node.simdTransform = matrix_multiply(currentFrame.camera.transform, translation) 

In Objective-C

matrix_float4x4 translation = matrix_identity_float4x4; translation.columns[3][2] = -0.1; // Translate 10 cm in front of the camera node.simdTransform = matrix_multiply(currentFrame.camera.transform, translation) 

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?