使用allowCameraControl时可以获取SCNView摄像机位置吗? [英] Can I get the SCNView camera position when using allowsCameraControl?

查看:168
本文介绍了使用allowCameraControl时可以获取SCNView摄像机位置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SCNView文档说,当用户更改视角时,将allowCameraControl设置为YES不会更新相机节点位置.当用户更改视角时,有什么方法可以获取用户修改的相机参数?

The SCNView documentation says that setting allowsCameraControl to YES does not update the camera node position when the user changes the point of view. Is there any way to get the user-modified camera parameters when the user changes the point of view?

推荐答案

启用allowsCameraControl时,SceneKit会将其自己的摄影机节点插入到场景中(作为场景根节点的直接子节点),并将该节点设置为视图的 .读取该节点的属性以找出相机的位置和方向,或读取节点的camera属性的属性以找到相机的视场,深度限制等.

When you enable allowsCameraControl, SceneKit inserts its own camera node into the scene (as an immediate child of the scene's root node), and sets that node as the view's pointOfView. Read the properties of that node to find out the camera's position and orientation, or the properties of the node's camera attribute to find the camera's field of view, depth limits, etc.

这篇关于使用allowCameraControl时可以获取SCNView摄像机位置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆