gpt4 book ai didi

swift - 3D 模型看起来与 ARKit 中的大小不一样

转载 作者:可可西里 更新时间:2023-11-01 00:55:11 26 4
gpt4 key购买 nike

问题陈述

我在 AR 中遇到一个问题,我们的模型尺寸与真实产品不匹配。这款 iPhone 与真实 iPhone 尺寸相同,但与真实产品不匹配。

IPhone Model Size - (5.44 x 2.64 x 0.28 in)

引用截图

iPhone 7 in ARKit

引用 .obj 文件 Download obj

最佳答案

.obj 的比例很可能不正确。

如果您将模型加载到 SceneKit Editor 中,然后单击右侧的“立方体”:

enter image description here

您将在 transforms 部分 中看到一个显示 Bounding Box 的区域。

您可以在此处查看您的模型尺寸是否真的合适:

enter image description here

在我的示例中,我的模型是 SCNPlane宽度高度 为 0.1m (10cm)。

如果您的边界框不正确,您将需要设置 scale,这可以使用 SCNNodescale 属性来完成> 例如:

model.scale = SCNVector3(0.1, 0.1, 0.1)

据此:

Each component of the scale vector multiplies the corresponding dimension of the node’s geometry. The default scale is 1.0 in all three dimensions. For example, applying a scale of (2.0, 0.5, 2.0) to a node containing a cube geometry reduces its height and increases its width and depth.

希望对你有帮助

关于swift - 3D 模型看起来与 ARKit 中的大小不一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51318895/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com