如何在 Three.js 中处理动画模型? [英] How do I handle animated models in Three.js?

查看:45
本文介绍了如何在 Three.js 中处理动画模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 Three.js 的基本问题.我用谷歌搜索但没有找到任何有用的东西......如何在 Three.js 中处理动画模型?我知道如何导入 .js 文件,并且我有一个从搅拌机导出为 .js 格式的动画立方体.我已经用 JSONLoader 导入了它,但是动画不会自己播放.所以这就是我的位置,我不知道怎么玩.

I have a basic question about Three.js. I've googled but didn't find anything useful... How do I handle animated models in Three.js? I know how to import .js files, and I have an animated cube exported from blender to .js format. I've imported it with the JSONLoader, but the animation wont play by itself. So that's where I am, I don't know how to play it.

我已经检查了文档,但我不知道我应该使用什么...尝试了 MorphAnimationMesh,当我记录长度时,它发现 250 帧.所以我猜出口很顺利.

I've checked the documentation but I don't know what I should use... Tried the MorphAnimationMesh, and when I log the length, it finds 250 frames. So I guess the export went well.

我正在使用 WebMatrix,但它似乎无法识别 dae 文件,所以我还没有尝试使用它们.对于他们,我也不知道如何处理动画.

I'm using WebMatrix and it doesn't seem to recognize dae-files, so I haven't tried with them yet. And for them as well I do not know how to handle animations.

请帮忙!

推荐答案

有很多three.js 源代码中的示例.您也可以在线查看它们,例如

There are plenty of examples in the three.js sources. You can also view them online, e.g.

还有另一种动画风格,称为骨架动画或蒙皮".但是,如果您发现 250 帧的变形,那么此时您无需担心,但了解它是很好的.Blender 可以同时导出两者 - 变形更加万无一失,但蒙皮占用的空间更少.

There's also another style of animation, called skeleton animation or "skinning". However, if you found 250 frames of morphs, then you don't need to worry about it at this point, but it's good to be aware of it. Blender can export both - morphs are more foolproof but skinning takes less space.

这篇关于如何在 Three.js 中处理动画模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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