SceneKit : how to update SCNGeometrySource

断了今生、忘了曾经 提交于 2019-12-11 08:30:48

问题


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

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


回答1:


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.

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: 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.



来源:https://stackoverflow.com/questions/29533199/scenekit-how-to-update-scngeometrysource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!