sách gpt4 ai đã đi

swift - ARKit 4,RealityKit - 将局部变换转换为世界变换

In lại 作者:行者123 更新时间:2023-12-05 02:50:31 25 4
mua khóa gpt4 Nike

在带有 RealityKit 的 ARKit 4 中,可以发现,例如,左手相对于骨架基部(臀部)的变换。有了lefthand transform(相对于hip)和hip transform(相对于world),如何计算lefthand transform relative to world? API在哪里?似乎当我弄清楚数学公式时,我可以使用 SIMD api。但我想应该有一个简单的 API 来做这种数学运算?谢谢。

编辑:添加一些代码以使其清晰..

guard let bodyAnchor = anchor as? ARBodyAnchor else { continue }
let skeleton = bodyArchor.skeleton
let leftHandModelTransform = skeleton.modelTransform(for: .leftHand)

// at this point. I have access to:
// hip transform (bodyArchor.tranform) which is in the world coordinate system;
// lefthand transform which is relative to hip of the skeleton model.
// what to do next? any api? or do I have to figureout math and then use simd apis ?
//

编辑:另外,有人可以推荐一本书/网页来描述如何在不同的 3D 计算中使用 SIMD 吗?我发现这篇文章(Augmented Reality 911 — Transform Matrix 4x4)非常有用。但它没有涉及两个向量空间之间的转换。

1 Câu trả lời

好的。在复习了所有关于矩阵、3D 变换和四元数的数学知识之后,我终于找到了解决方案!它实际上被埋在RealityKit API :

func convert(normal: SIMD3, from referenceEntity: Entity?) -> SIMD3

我必须创建两个实体才能使用此 API。但至少它有效......

关于swift - ARKit 4,RealityKit - 将局部变换转换为世界变换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63652315/

25 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com