SceneKit:如何更新SCNGeometrySource [英] SceneKit : how to update SCNGeometrySource

查看:54
本文介绍了SceneKit:如何更新SCNGeometrySource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个非常出色的iOS项目.我决定使用sceneKit作为主要框架.我遇到了一个问题:

I am working on an very awesome iOS project. And i decided to use sceneKit as main Framework. I got an issue :

当我在其上应用动画时,如何更新节点的SCNGeometrySource?

How to update the node's SCNGeometrySource, when i apply an animation on it ?

推荐答案

这是预期的行为.移动节点时,它不会更改附加几何对象的点数据.转换也是如此.

That is the expected behavior. When you move a node, it does not change the point data for the attached geometry object. The same is true for transforms.

相反,几何图形(和几何图形源)中的点数据始终相对于几何图形本身.

Instead, the point data in the geometry (and the geometry source) is always relative to the geometry itself.

渲染场景时,节点的位置和变换(及其父节点的位置和变换)用于创建单个变换矩阵,该矩阵将几何的位置和法线从模型坐标空间"转换为视图"坐标空间",并将其投影到屏幕 1 .

When the scene is rendered, the node's position and transform (and that of it's parent node) is used to create a single transformation matrix who transforms the positions and normals of the geometry from the "model coordinate space" into the "view coordinate space" and projects it into the screen1.

1:稍微简化了一点,但是在描述此转换的工作原理时,不需要像OpenGL这样的技术.如果您真的想阅读所有涉及的步骤,可以搜索剪辑空间",透视划分"和规范化的设备空间".

1: That's a slight simplification but there is no need to be as technical as OpenGL when describing how this transformation works. If you really want to read about all the steps involved, "clip space", "perspective division", and "normalized device space" are some keywords you can search for.

这篇关于SceneKit:如何更新SCNGeometrySource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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