问题描述
如何加载obj:
guard let urlOBJ = Bundle.main.url(forResource: "myOBJ",withExtension: "obj") else {NSLog("error loding obj ");return}
let assetOBJ = MDLAsset(url: urlOBJ)
let objectOBJ = assetOBJ.object(at: 0)
OBJNode = SCNNode(mdlObject: objectOBJ)
OBJNode.name = OBJNode
annotationNode.addChildNode(OBJNode)
如何设置:
annotationNode.childNode(withName:"OBJNode",recursively: true)!.renderingOrder = 1000
annotationNode.childNode(withName:"Background",recursively: true)?.geometry!.firstMaterial?.readsFromDepthBuffer = false
annotationNode.childNode(withName:"Background",recursively: true)?.geometry!.firstMaterial?.writesToDepthBuffer = false
annotationNode.childNode(withName:"Background",recursively: true)!.renderingOrder = 100
请不要要求我将.scn转换成数百个OBJ。 。
还有其他选择吗?对此有任何官方解释吗?
谢谢!
解决方法
已解决
OBJ位于两个不同的父对象中,并且renderOrder不是递归的。
谢谢。