0 Replies
      Latest reply on May 11, 2018 11:50 AM by geoffheatley
      geoffheatley Level 1 Level 1 (0 points)

        Hey Apple!


        Is there someone there at Cupertino who can tell me how I can manually create an ARSCNFaceGeomtery with my own SCNGeometrySources & SCNGeometryElements. I would be using the same vertices (so the blendshapes would still work) but i want to provide a new textureCoords source so I can map the face differently with a different texture projection. The standard front-projection is great but is very limiting.


        I've been on this 3 days now and I've sussed it down to needing to create a metalBuffer-centric SCNGeometry source like so:


        let metalBuffer: MTLBuffer = device.makeBuffer(bytes: UnsafeRawPointer(bytes), length: bytes.count * MemoryLayout.sizns: [.storageModeMemoryless])!
                let metalSource = SCNGeometrySource(buffer: metalBuffer, vertexFormat: MTLVertexFormat.float3, semantic: SCNGeometrySource.Semantic.vertex, vertexCount: bytes.count/4, dataOffset: 0, dataStride: MemoryLayout.size)


        -I'm also assuming this is why device needs to be passed to ARSCNFaceGeometry when initializing it the standard way.


        Please can someone who made the ARFaceTracking at Apple please shine some light on it and give me the lines of code I need to create it from sources & elements?