gpt4 book ai didi

ios - 如何将一个 SCNNode 指向另一个 SCNNode?

转载 作者:可可西里 更新时间:2023-11-01 01:03:29 25 4
gpt4 key购买 nike

我的场景中有一系列(平面)节点,我需要它们始终面向相机。

如何调整变换/旋转以使其正常工作?

另外,我在哪里进行计算?

目前我正在尝试在 SCNSceneRendererDelegate renderer:updateAtTime: 委托(delegate)方法中实现用户交互。

最佳答案

SCNBillboardConstraint 怎么样?这将您限制为 iOS 9/El Capitan/tvOS。将约束添加到每个平面(广告牌)节点。

来自 SceneKit 框架引用:https://developer.apple.com/library/ios/documentation/SceneKit/Reference/SCNBillboardConstraint_Class/index.html

An SCNBillboardConstraint object automatically adjusts a node’s orientation so that it always points toward the pointOfView node currently being used to render the scene.

在更一般的情况下,SCNLookAtConstraint 将保持任何节点的负 Z 轴指向任何其他节点。

关于ios - 如何将一个 SCNNode 指向另一个 SCNNode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33227018/

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