本文介绍了在 SceneKit 中追逐相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个立方体节点并且我正在场景中移动它,我怎么能有一个跟随盒子的相机?

Say I have a node which is a cube and I am moving it within the scene, how can I have a camera that follows the box?

我知道有 SCNLookAtConstraint,但我想要的是追逐相机.一个实际上改变了它的位置,以便它有点附加在节点后面.

I understand there is SCNLookAtConstraint, but what I am after is a chase camera. One that actually changes it's position so that it is sort of attached behind the node.

我还没有找到任何示例代码来展示实现这一点的方法,有没有人有任何想法?

I have not found any example code which shows a way of implementing this, does anyone have any ideas?

推荐答案

可以不让你的相机节点成为盒子节点的子节点吗?

Can you not make your camera node a child node of the box node?

这篇关于在 SceneKit 中追逐相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 06:33