2017-08-08 30 views

回答

7

與iOS SDK 11,可以使用初始化到SCNMatrix4之間轉換simd_float4x4

import SceneKit 

var mat4 = SCNMatrix4() 

let f4x4 = simd_float4x4(mat4) 

mat4 = SCNMatrix4(f4x4) 
0

你可以使用SCNMatrix4ToMat4

let matrix = SCNMatrix4()    // matrix is SCNMatrix4 
let float4x4 = SCNMatrix4ToMat4(matrix) // float4x4 is matrix_float4x4 

如果你想SCNMatrix4轉換爲matrix_float4x4,使用SCNMatrix4FromMat4

let matrix1 = SCNMatrix4FromMat4(float4x4) // matrix1 is SCNMatrix4 
相關問題