我曾经使用某些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便利的东西。
答案 0 :(得分:0)
RealityKit没有API在运行时创建自定义几何。