【问题标题】:Apple RealityKit: How to draw a polygon plane using ModelEntity?Apple RealityKit:如何使用 ModelEntity 绘制多边形平面?
【发布时间】:2020-02-12 20:30:24
【问题描述】:

我曾经使用过一些 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 的便利。

【问题讨论】:

    标签: ios scenekit augmented-reality realitykit


    【解决方案1】:

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


    编辑: RealityKit 2 引入了对动态网格的支持。请参阅来自 WWDC21 的 Explore advanced rendering with RealityKit 2

    【讨论】:

    • 看来是真的少了这些API。
    • 所以我必须使用 SceneKit?
    • RealityKit 2 引入了对动态网格的支持。
    猜你喜欢
    • 2021-08-22
    • 2021-05-05
    • 2019-10-03
    • 1970-01-01
    • 2014-03-03
    • 1970-01-01
    • 2020-03-23
    • 1970-01-01
    • 2015-08-02
    相关资源
    最近更新 更多