ios - 苹果 RealityKit : How to draw a polygon plane using ModelEntity?

标签 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 便利性的东西。

最佳答案

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


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

关于ios - 苹果 RealityKit : How to draw a polygon plane using ModelEntity?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58406866/

相关文章:

android - 增强图像被检测到但未被跟踪

ios - 检测并记录所有手势

iOS Realm级联删除

swift - 无法获取 locationInView : for this type of NSTouch assertion error when trying to retrieve location

ios - 在 Xcode 场景编辑器中应用纹理不起作用

ios - 将 SceneKit 节点从 DAE 文件转换为物理体

android - AR Android应用程序的3D对象识别

augmented-reality - 如何将 .arobject 文件转换为 .usdz 文件?

iphone - UIButton 的触摸检测添加为 UIScrollView 中的 subview

ios - 如何在不禁用 ASLR 的情况下计算应用程序在内存中的位置?