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
Post a Comment