Apple RealityKit:如何使用ModelEntity绘制多边形平面?

时间:2019-10-16 06:19:18

标签: ios scenekit augmented-reality realitykit

我曾经使用某些SceneKit API,例如

SCNGeometrySource(vertices: vertices)

SCNGeometryElement(data: indexData,
                   primitiveType: .polygon,
                   primitiveCount: 1,
                   bytesPerIndex: MemoryLayout<Int32>.size)

SCNShape(path: bezierPath, extrusionDepth: 0.0003)

实现在场景中绘制多边形。

如今,我正在尝试通过RealityKit重写实现。 但是我只发现了一些基本的网格API,例如

generatePlane(width: Float, height: Float, cornerRadius: Float = 0) -> MeshResource
generatePlane(width: Float, depth: Float, cornerRadius: Float = 0) -> MeshResource
generateBox(size: Float, cornerRadius: Float = 0) -> MeshResource
generateSphere(radius: Float) -> MeshResource
...

我希望能得到一些更接近SceneKit便利的东西。

1 个答案:

答案 0 :(得分:0)

RealityKit没有API在运行时创建自定义几何。