Extract animation vertices

旧街凉风 提交于 2019-12-24 22:41:01

问题


I have an object loaded with GLTFLoader and an animation using THREE.AnimationMixer. I know I can get vertices of the object by using .fromBufferGeometry().vertices on the Mesh geometry. How can I get all the vertices during an animation and see how they change over the time? KeyframeTrack does not seem to modify geometry directly.


回答1:


I know I can get vertices of the object by using .fromBufferGeometry().vertices on the Mesh geometry.

It's not necessary to convert your geometry to Geometry (which is going to be removed from the library at some point). Instead you can access vertex information by working with the respective buffer attributes. The documentation page about BufferGeometry provides more details about this topic.

How can I get all the vertices during an animation and see how they change over the time?

When using animation techniques like skeletal animation or morph target animation, it's important to realize that the actual vertex displacement happens in the vertex shader (GPU). If you need transformed vertices in your JavaScript code (CPU) for some reasons, you have to manually perform the respective vertex displacement. There is no library functionality that can do this for you right now. But you might find some code samples at the forum or at github.



来源:https://stackoverflow.com/questions/54590938/extract-animation-vertices

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