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

Chemistry - Bond Angles In NH3 And NCl3

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Change The Font Size Of Visual Studio Solution Explorer