简体   繁体   English

Forge Viewer动画

[英]Forge Viewer animation

We have some animated objects in our 3DS Max file. 我们的3DS Max文件中有一些动画对象。 Would it be possible to display these animations in the viewer? 是否可以在查看器中显示这些动画? We've seen some examples from the Forge developers showcasing animated robots. 我们从Forge开发人员那里看到了一些展示动画机器人的示例。 Would really like to get information on how to achieve animations in the viewer. 真的很想获得有关如何在查看器中实现动画的信息。

The model derivative translation of the .MAX file does not include animation. .MAX文件的模型派生转换不包括动画。 It uses the current keyframe state of the geometry to translate, and no animation is included. 它使用几何图形的当前关键帧状态进行平移,并且不包含动画。 At the moment, only certain translation types include source animation. 目前,只有某些翻译类型包括源动画。 For example, the Fusion format can contain animation, and those can be played back in the Forge Viewer. 例如,Fusion格式可以包含动画,而这些动画可以在Forge Viewer中播放。 See here for information on that aspect: https://forge.autodesk.com/blog/show-animation-and-cam-content . 有关此方面的信息,请参见此处: https : //forge.autodesk.com/blog/show-animation-and-cam-content

Because the Forge Viewer is using three.js, you can add your own animation. 由于Forge Viewer使用three.js,因此您可以添加自己的动画。 This is how the robot was animated (assuming you are referring to these samples: interactive: http://mimikron-project.s3-website.us-east-2.amazonaws.com/ and preforming: http://mimikron-project.s3-website.us-east-2.amazonaws.com/cyberdancer.html ) 这是机器人是如何动画(假设你指的这些样品:互动: http://mimikron-project.s3-website.us-east-2.amazonaws.com/和预成型: HTTP:// mimikron项目.s3-website.us-east-2.amazonaws.com / cyberdancer.html

There are two good blog posts that discuss this starting here: https://forge.autodesk.com/blog/know-how-complex-component-transformations-viewer-part-1-basics (and see end for part 2 link). 有两个不错的博客文章,从这里开始讨论了这个问题: https : //forge.autodesk.com/blog/know-how-complex-component-transformations-viewer-part-1-basics (有关第2部分的链接,请参见结尾) 。 Note the running sample of the gyro clock is posted here: http://giro-watch.tk/ You can see the time is animated based on the browser current time, and there are also controls for interactive animation/transforms. 请注意,陀螺仪时钟的运行示例发布在这里: http : //giro-watch.tk/您可以看到时间是根据浏览器当前时间进行动画处理的,还提供了用于交互式动画/变换的控件。

Hope it helps, kevin 希望能有所帮助,凯文

In addition to Kevin's answer, if you are using (or can use) .fbx then you could extract the animations data by using the FBX C++ SDK and load it in the viewer but the whole workflow has to be a custom implementation. 除了Kevin的答案外,如果您正在使用(或可以使用).fbx,则可以使用FBX C ++ SDK提取动画数据并将其加载到查看器中,但是整个工作流程必须是自定义实现。

I just published a new sample that uses the hierarchical transforms approach exposed in the blog article. 我刚刚发布了一个新示例,该示例使用了博客文章中介绍的分层转换方法。 It also lets you save the transform state in the database and perform smooth animation to transition between two arbitrary states: 它还使您可以将转换状态保存在数据库中,并执行平滑的动画以在两个任意状态之间转换:

See the live demo here and the code at Viewing.Extension.Kinematics 此处查看实时演示以及在Viewing.Extension.Kinematics上的代码

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM