ios - 如何为 SCNSphere 选择合适的半径?
问题描述
我正在开发 360 度图像查看器,为此我使用 SCNSphere。问题是创建球体时应该使用什么半径?
到目前为止,我注意到将半径设置在 10 到 100 之间的任何位置都可以在我的图像上正常工作。但是,假设图像环绕球体,半径不应该是 2*Pi / image.width (其中 C = 2*Pi*R)?不知何故,这在我使用的尺寸为 1600 x 800 的图像上根本不起作用。
这是我的代码:
let material = SCNMaterial()
material.diffuse.contents = image360
let sphere = SCNSphere(radius: 10)
sphere.segmentCount = 300
sphere.firstMaterial = material
let node = SCNNode()
node.geometry = sphere
为了澄清这个问题:如何为 SCNSphere 选择合适的半径,图像(比如尺寸为 1600x800)作为材料?
谢谢!
解决方案
推荐阅读
- php - 如果用户输入了错误的登录信息,登录验证会显示警报
- javascript - 如何在使用 Javascript 初始加载后检测网页是否正在重新加载?
- angular - Angular 6 中两个具有通用组件的延迟加载模块
- asp.net - Auth0 查询参数 (q=) 未返回预期结果
- c++ - 内置类型的基于 C++ 类型的分派
- c# - NetworkCredential 在 IIS 服务器第二个请求之后不起作用
- .net-core - 运行 dotnet 核心应用程序时找不到本地主机
- android - 无法绑定/连接到作为 AAR 库的一部分创建的远程服务
- android - 如何以编程方式为android启用前置摄像头而不是后置摄像头?
- assembly - 当我们有编译器时,为什么我们甚至需要汇编器?