У меня возникла проблема с пониманием геометрии сценки.
У меня есть куб по умолчанию от Blender, и я экспортирую его как collada (DAE), и могу привести его в scenekit.... все хорошо.
Теперь я хочу видеть вершины для куба. В DAE я вижу следующее для "Cube-mesh-locations-array",
"1 1 -1 1 -1 -1 -1 -0,9999998 -1 -0,9999997 1 -1 1 0,9999995 1 0,9999994 -1,000001 1 -1 -0,9999997 1 -1 1 1"
Теперь то, что я хотел бы сделать в scenekit, вернет вершины, используя что-то вроде следующего:
SCNGeometrySource *vertexBuffer = [[cubeNode.geometry geometrySourcesForSemantic:SCNGeometrySourceSemanticVertex] objectAtIndex:0];
Если я обрабатываю vertexBuffer (я пробовал множество методов поиска данных), это не кажется правильным.
Может кто-нибудь объяснить, что мне дает "SCNGeometrySourceSemanticVertex", и как правильно извлекать данные вершин? Я бы хотел увидеть:
X = "float"
Y = "float"
Z = "float"
Также я изучал следующие класс/методы, которые выглядели многообещающими (некоторые полезные значения данных здесь), но данные из gmpe кажутся пустыми, может ли кто-нибудь объяснить, что содержит свойство данных "SCNGeometryElement"?
SCNGeometryElement *gmpe = [theCurrentNode.geometry geometryElementAtIndex:0];
Спасибо, помощь очень ценится,
D