ios - How to convert from ModelIO MDLMesh to SceneKit SCNGeometry and back? -


apple have announced model i/o framework and, understandably, documentation quite sparse many classes still not documented. model i/o talk suggests two-way link between scenekit classes , model i/o classes, can't find way in practice.

scngeometry has convenience init accepts mdlmesh object, i'm not sure how go other way , generate mdlmesh object pre-existing scngeometry.

the init mdlmesh is:

init(vertexbuffer vertexbuffer: mdlmeshbuffer,      vertexcount vertexcount: int,      descriptor descriptor: mdlvertexdescriptor,      submeshes submeshes: [mdlsubmesh]) 

or, alternatively, same vertexbuffers: [mdlmeshbuffer] (where vertex buffer corresponds scenekit geometry source), can't figure out go here.

(it looks mdlmeshbuffer has method takes filldata: nsdata parameter, , know scngeometry.geometrysources gives array of scngeometrysources each .data provides these geometry sources nsdata object, i'm not sure if right way go doing it.)

any guidance appreciated.

according engineers in labs @ wwdc, scenekit model i/o bridge isn't in first beta, should show in beta later in summer.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -