OGRE中的人脸动画.
AE中的人物角色骨骼动画技术解析
![AE中的人物角色骨骼动画技术解析](https://img.taocdn.com/s3/m/f8ffb4f168dc5022aaea998fcc22bcd126ff4217.png)
AE中的人物角色骨骼动画技术解析Adobe After Effects(简称AE)是一款广泛应用于电影后期制作和动态影片特效制作的软件。
在AE中,人物角色骨骼动画技术是一项重要的技巧,它可以实现人物的自然动作和流畅运动。
本文将解析AE中的人物角色骨骼动画技术,帮助读者掌握这一重要的制作技巧。
人物角色骨骼动画技术是指在AE中使用骨骼系统来控制人物的动作。
通过对人物角色的关节进行绑定,可以使其具有真实的骨骼结构,从而实现更加自然的动作效果。
首先,需要创建一个人物角色的骨架。
在AE中,可以使用“Null Object”来创建骨骼,将其命名为各个关节的名称(例如脚、膝盖、臀部等)。
接下来,将这些关节通过“Parent”选项进行层级关联,建立起骨骼系统的结构。
一旦骨骼系统创建完成,就可以开始对人物角色进行动画制作了。
首先,选择一个关键帧位置进行动画制作。
通过调整关节的旋转角度和位置,可以实现人物角色的运动效果。
需要注意的是,关节的运动是通过旋转进行控制的,因此要根据人物的运动特点进行合理的调整。
在制作人物角色骨骼动画时,关键帧的设置非常重要。
可以通过添加关键帧来控制人物的不同姿势和动作。
例如,可以在人物行走时添加一个关键帧来产生蹲下的动作效果。
此外,AE还提供了一些有用的插件和工具,可以帮助优化人物角色骨骼动画的制作过程。
例如,可以使用IK插件来自动计算关节的旋转角度,简化动画制作的过程。
除了基本的动画制作,AE还支持一些高级的人物角色骨骼动画技术。
例如,可以使用“表情控制器”来实现人物面部表情的自动控制,使其更加生动。
还可以使用“布料模拟”等功能来实现人物服装的自然运动效果。
总结起来,人物角色骨骼动画技术是AE中的一项重要技巧,可以使人物角色的动作更加自然和流畅。
通过创建骨骼系统和合理设置关键帧,可以实现各种复杂的人物角色动作效果。
此外,AE提供了一些插件和工具,可以进一步优化制作过程,并实现更加高级的人物角色骨骼动画效果。
08_Ogre动画基础
![08_Ogre动画基础](https://img.taocdn.com/s3/m/3f58c6c5bb4cf7ec4afed068.png)
骨骼动画
骨骼动画是根据网格数据中的骨骼信息来产生动画效 果,一般是根据顶点上绑定的骨骼信息轮询确定模式 的顶点。另一个叫法是骨骼蒙皮。骨骼动画一般是通 过3d建模工具完成的。OGRE提供导出工具 OgreXMLconverter,来将建模工具制作的骨骼动画导 出为引擎可以应用的格式。 骨骼和动画信息被保存在以.skeleton结尾的文件中, 可以通过OGRE的exporters导出。当创建一个基于某个 mesh的实体的时间,如果mesh上有动画信息,那么 相应的.skeleton文件会被自动加载。
骨骼动画的实现 实现步骤
(4) 然后在 ExampleFrameListener 的继承类中,覆盖帧开始事件处理方 的继承类中, 在其中进行动画状态的更新。 法 frameStarted() ,在其中进行动画状态的更新。 bool SkeletonAnimationFrameListener::frameStarted( const FrameEvent & evt ) { // 更新动画状态 mAnimState->addTime( evt.timeSinceLastFrame * mAnimationSpeed ); // 调用默认帧开始事件处理方法 return ExampleFrameListener::frameStarted( evt ); } 其中, const FrameEvent& evt 是 OGRE 系统事件,类似 于 Windows API 的系统消息 msg 。
思考练习
1. 2. 编写本讲的样例程序。 为什么要实现多种不类型的动画。
场景节点动画
为了做场景结点运动的动画,场景结点动画从场景管理器 中创建,它使得与与之关联的对象自动的随着一起移动。 你能在演示Demo_CameraTrack中看到照相机的轨迹行为, 也可以在Demo_Fresnel的池塘中看鱼如何移动的。 在主要的部分,场景结点动画与在骨骼动画中的基本骨骼 的代码非常相似,在使用SceneManager::createAnimation 创建主动画后,你能为你要动画化的每个SceneNode创建 对应的一个NodeAnimationTrack,并创建关键帧来控制位 置、方向和线性插值或是曲线的缩放。你也可以与骨骼/顶 点动画相同的方式,使用动画状态。否则你需要包含来自 与SceneManager的状态,来取代来自独立实体的状态。动 画被自动应用到每一帧上,或是使用高级的在 SceneManager上的_applySceneAnimations()方法来被应用。
HeadBox:Microsoft Rocketbox库的面部融合动画工具包说明书
![HeadBox:Microsoft Rocketbox库的面部融合动画工具包说明书](https://img.taocdn.com/s3/m/5ae3196c86c24028915f804d2b160b4e767f81ec.png)
HeadBox:A Facial Blendshape Animation Toolkitfor the Microsoft Rocketbox LibraryMatias Volonte,Eyal Ofek,Ken Jakubzak,Shawn Bruner,and MarGonzalez-FrancoFig.1.Image depicting pairs of Microsoft RocketBox characters showing identical facial expressions.Abstract —HeadBox is a series of opensource tools to do facial animation on the Microsoft Rocketbox avatar library.It includes a tool to create blendshapes out of the facial bones inside Maya and transfer the new blendshapes to the other avatars in the library.We have created a total of 15visemes,48FACS,30for the Vive facial tracker.These blendshapes have been released with the original library.An additional Unity demo shows the use these tools with Openface and Oculus Lipsync.Index Terms —Microsoft Rocketbox,Avatars,Virtual Humans,Open-Source,Blendshapes,Animation,Facial,Rigging1I NTRODUCTIONAvatars are digital representations of humans that can be used in Virtual Reality and digital media to replicate their appearance and behavior.In particular avatars are critical for tasks that demands social interactions,where facial expressions are a vital.Indeed,facial animation is a key component of avatar animation,in the same way that moving our body will allow us to interact with our environment our facial expressions will express emotions and help us interact with others.For avatars,facial expressions are also important not only to have good Lipsync so avatars can talk,but also to provide better non verbal cues during virtual interactions.We need them to feel avatars are alive inside VR.There is evidence that facial animation has a deep impact during simulated social interactions.Previous research has shown that faces of avatars that are animated receive more attention than those that are not [11].Studies have also compared the effect of facial cues during interactions and found that avatars providing facial expressions were more appealing,and the interaction was rated more positively than when avatars lack facial expressions [14].The Enfacement Illusion is also greater when avatars are animated,specially if the avatars are presented in first person perspective in front of a mirror [11].Animation realism can also affect perceived appeal on characters [13].Enfacement is the illusion wherein the cognitive representation of one’s face allows a person to embody another indi-vidual’s face.Emotional facial expressions may affect the enfacement illusion by increasing the spectator’s grounds to comprehend the cog-nitive condition of the avatar [2].In fact,facial animation perception•Matias Volonte is with Northeastern University.•Shawn Bruner was with Microsoft•Ken Jakubzak,Eyal Ofek and Mar Gonzalez-Franco are with Microsoft.Corresponding E-mail:can alter our understood personality of avatars even when these are not human-like [8].Even though facial animation of avatars still poses many challenges,such as overcoming the uncanny valley,overall it has a lot of potential for our future.Current technology advancements offer promising ad-vancement in the area of avatars,such as the Metahumans library [7],the Microsoft’s Rocketbox library [10],or MB-Lab for blender [15].These open-source options can provide a good starting alternative for the community to explore the effects of facial avatar animation in virtual reality (VR)and augmented reality (AR).However,for the case of the Microsoft Rocketbox avatar library [10],the animation is currently restricted to the facial bones,which are not the most widely used form nor convenient form of facial animation,as opposed to blendshapes.Here we present a series of tools that will help bridge that gap.We describe the process of developing facial expressions attributes to the existing Microsoft’s Rocketbox Avatars library [10].The Rocketbox package is a popular open-source library of 115human characters representing different demographics (gender,age,race,or professions),fully rigged,and animation ready.We extended the attributes of the existing Rocketbox package by providing facial expressions and lip sync-capabilities.In total we modeled 110facial blendshapes.These includes 15visemes,48facial action units,30expressions compatible with the vive facial tracker,and 17custom facial expressions that show combinations of emotional,tongue,and gaze blendshapes interesting for future users.In all this paper contributes with a tool to create and export proce-durally blendshapes out of facial bones to all the Microsoft Rocketbox avatars,an upgraded release of the library with series of embedded blendshapes on the avatars.A Unity demo using the visemes for Lip-sync and the FACS [6]animations,using Openface [1]for real-time animation of the face using web camera input.We hope more people will now be able to use our Headbox Maya tool,to customize and generate even more blendshapes.2022 IEEE Conference on Virtual Reality and 3D User Interfaces Abstracts and Workshops (VRW)2022 I E E E C o n f e r e n c e o n V i r t u a l R e a l i t y a n d 3D U s e r I n t e r f a c e s A b s t r a c t s a n d W o r k s h o p s (V R W ) | 978-1-6654-8402-2/22/$31.00 ©2022 I E E E | D O I : 10.1109/V R W 55335.2022.00015Finally,this open-source package has the goal of promoting a free exchange of ideas within the virtual human community to drive creative, scientific,and technological advancement.2R ELATED W ORKOur work builds on top of existing standards and is inspired by other opensource tools.2.1Facial AnimationWe aim for our blendshapes to be as compatible as possible with FACS. The Facial Action Coding Systems[6]is a manual that describes mul-tiple facial muscle configurations,or anatomically based action units, creates distinct facial expressions.The FACS describe the subtle differ-ences in the configuration that outcomes from different muscle move-ments.In fact FACS has been shown a viable choice for avatar animation and there are even opensource libraries like FACSvatars that have built on top of it.FACSvatar implements openFace[1]for facial landmark detection,head pose estimation,facial action unit recognition,and eye-gaze estimation to output an animated character in Unity or Blender.Additionally we aim to implement visemes for lipsync performance and additional precombined blendshapes with facial expressions and emotions.2.2Avatar LibrariesThere are multiple avatar libraries available.However not all of them are opensource.Here we review a couple of the most used ones and they to see what facial animation characteristics they have.USC Institute for Creative Technologies:The University of Southern California(USC)Institute for Creative Technologies(ICT)developed the Virtual Human Toolkit.This package includes a set of modules, tools,and libraries conceived for researchers and developers with the creation of virtual human conversational characters[12].Users can create dialogue responses to input to one or multiple characters,ma-nipulate the agent’s non-verbal expressions,animate the agent’s body, gaze,lip-synch in real time using the Behavior Markup Language (BML),and track the user’s facial and head behaviors through webcam to trigger the avatar’s reactions.Mixamo:This open-source system allows users to access free char-acters and an extensive animation library[3].Users can select motion capture animations,edit them,and apply them to digital characters. Additionally,users can upload their custom characters and auto rig them using Mixamo’s proprietary tool.This process requires the user to place makers on the agent(wrists,elbows,knees,and groin)and the tool creates the body rig automatically.Several of the example avatars that Mixamo provides have facial blendshapes that are compatible with HeadBox,however not all of them include blenshapes nor are following the FACS standard per se,and also sometimes they don’t have visemes.Epic Games MetaHumans:MetaHuman is a tool for creating high-quality digital character for the Unreal ers can create photo-realistic digital humans,fully rigged and complete facial blendshapes with hair and clothing.This package provides an advanced facial rig system(named“Puppet”)to animate the agent’s facial expressions.The MetaHuman virtual agents support motion capture animation and they can be animated in3D applications like Autodesk Maya.MakeHuman:This package is a professional open-source software for creating virtual human characters[4].MakeHuman allows users to edit granularly the attributes of the virtual ers can modify the agent’s gender,age,muscle,weight,height,physical proportions,skin, and race.Also,the characters are rigged and support motion capture ers can select different outputs(Game,Mocap,Detailed hands,Facial Bones,Detailed Hands,etc.),that will determine the rig structure.Microsoft Rocketbox:This library contains115characters repre-senting different races,ages,and genders.The library is designed for research mainly,and even though the license is MIT free it is mostly in use by researchers in areas such as sociology,psychology,VR,crowds, and HCI.One particular aspect of the library is that its avatars represent everyday characters and professions,which makes it very attractivefor Fig.2.Image showing the tool for creating and transferring the facial expressions.research.The avatars are fully rigged and their topology is optimized for performance.These agents are mid-to-highfidelity looking and support motion capture animation.A RocketBox agent possess a total of81joints.3S YSTEM D ESCRIPTIONOur goal is to develop a system to create and distribute accurate and consistent facial expressions to115different characters of the Microsoft Rocketbox Avatar Library.This process involved afirst step for se-lecting the visemes,action units[6],and custom facial expressions to be developed.We want to provide new blendshapes that followed the FACS standard,(Facial Action Code System),based on muscular movements[6]and blendshapes that would allow people to do good lip-sysnc with visemes.We also account for compatibility with facial animation tools like Vibe Facial Tracker,oculus lipsync and openface which means we needed to create more blendshapes.While Microsoft Rocketbox Avatars were not designed to support blendshapes,but rather based on facial bones,we developed a new tool,supplied with the opensource Headbox toolkit,that can generate equivalent results.3.1HeadBox Blendshape Creation ToolWe developed A Maya based tool,named Headbox blendshape creation tool,which is a custom pipeline for developing,storing,and transferring the blendshapes to all the Microsoft RocketBox characters.In a single step,a designer of a particular blendshape can export a particular blendshape to all the avatars in the library.This system was developed in Python in Autodesk Maya(see Figure3).The tool supports the following properties:•Save and load joints transform data.•Transfer joints information to all characters.To transfer the facial motions among different avatars,we take advantage of a similar facial bone rigging across all of the Microsoft RocketBox avatars.However,different avatars have different meshes, as well as bone length.Applying similar rotations of corresponding bones may generate different facial expressions.To compensate for this difference,we applied a correction which is unique per avatar.Within Maya,we can apply a desired blendshape to the mesh of the avatar’s face,and compare it to the result of applying rotations on the avatar’s facial bones.We estimate a additional transformation of the joint position,that will minimize the difference between the two transformations.Such offset takes into account the variation of the bones lengths.δ=JointTargetPosition−JointOriginPositionApplying these offset translations to bone origins,which means we make use of the neutral character mesh,generates meshes that resembles the expression over different avatars,while also maintain the facial bone dynamics.A part of the development of the tool,we used image references from the existing literature to manually model the facial expressions by manipulating the facial joints present of a specific avatar of the library.After generating similar experesions to the reference ones,all model joints’transform data was saved to a Json file.This process was repeated for all the facial ing this data,we successfully transferred modeled expressions all other avatars in the library.In total we modeled 111facial blendshapes.These includes 15visemes,48facial action units,30expressions compatible with the vive facial tracker,and 17custom facial that show combinations of emotional,tongue,and gaze blendshapes interesting for future users.3.2Headbox Realtime DemonstrationTo test the new blendshapes we developed a real-time tool in Unity that includes openface compatibility [1]and Oculus Lipsync (see attached video).The lip-sync animation was tested on Oculus LipSync [17]and on Salsa LipSync [16].Salsa provides the possiblity of using 17blend-shapes by default with the option of increasing this number compared to the 15that are provided by Oculus Lipsync.The results with both packages weresatisfactory.Fig.3.Image of a person demoing the Unity tool with Openface.One thing to note is that lipsync animation was significantly better when done from audio than from the computer vision approach provided by Openface.This could be due to limitations on Openface where only 17action units are represented for the whole face,while visemes alone on oculus lipsync,based only at the mouth already account for 15variations.This could be overcomed if more mouth positions would be detected from a different computer vision solution in the future.Therefore,we recommend using openface for the rest of the face and audio driven animation for speech to blendshape.The toolbox also includes blendshapes to be used with the ViVe facial tracker,however despite them being implemented we didn’t test them for performance.All the blendshapes can be modulated at runtime inside Unity to reduce their dinamic range using our demonstartion starter kit on github.Although not included in this toolbox,previous work has also shown that full facial animation can be achieved only by audio,like the one proposed by JALI [5].4D ISCUSSIONWe decided to use a procedural approach for modeling the facial blend-shapes by manipulating generating approximating facial bone trans-forms,supported by Microsoft Rocketbox avatars (position,rotation,and scale).The current facial rig included a total of 29joints.This small number of joints can limit the accuracy and quality of the blend-shapes.Traditionally artist animated blendshapes also take into accountindividual vertexes,which in our case wasn’t an option if we wanted to be compatible and procedural transfer between different avatars.However,using the Maya tool we developed to transfer blendshapes between avatars,users can now improve blendshapes or create new ones.The facial mesh resolution,used by the avatar library has limited resolution,optimized for performance.This may have affected the modeling of the facial expressions,in the same way that the restriction on facial bones can also have an effect.This new toolbox is compatible with other Microsoft Rocketbox tool-sets such Movebox recording studio [9],for recording and playing body motions along with the facial animations.The HeadBox with the Maya tool for generating new blendshapes will be available in a new GitHub https:///openVRlab/Headbox.Also,The Microsoft Rocketbox library with updated facial expressions will be freely accessible inside the original Microsoft Rocketbox avatar GitHub https:///microsoft/Microsoft-Rocketbox.R EFERENCES[1]T.Baltru ˇsaitis,P.Robinson,and L.-P.Morency.Openface:an open source facial behavior analysis toolkit.In 2016IEEE Winter Conference on Applications of Computer Vision (WACV),pp.1–10.IEEE,2016.[2] B.Beck,F.Cardini,E.L `adavas,and C.Bertini.The enfacement illusion is not affected by negative facial expressions.PloS one ,10(8):e0136273,2015.[3]S.Blackman.Rigging with mixamo.In Unity for Absolute Beginners ,pp.565–573.Springer,2014.[4]L.Briceno and G.Paul.Makehuman:a review of the modelling framework.In Congress of the International Ergonomics Association ,pp.224–232.Springer,2018.[5]P.Edwards,ndreth,E.Fiume,and K.Singh.Jali:an animator-centricviseme model for expressive lip synchronization.ACM Transactions on graphics (TOG),35(4):1–11,2016.[6]P.Ekman and W.V .Friesen.Facial action coding system.EnvironmentalPsychology &Nonverbal Behavior ,1978.[7]Z.Fang,L.Cai,and G.Wang.Metahuman creator the starting point of themetaverse.In 2021International Symposium on Computer Technology and Information Science (ISCTIS),pp.154–157.IEEE,2021.[8]Y .Ferstl,E.Kokkinara,and R.McDonnell.Do i trust you,abstractcreature?a study on personality perception of abstract virtual faces.In Proceedings of the ACM Symposium on Applied Perception ,pp.39–43,2016.[9]M.Gonzalez-Franco,Z.Egan,M.Peachey,A.Antley,T.Randhavane,P.Panda,Y .Zhang,C.Y .Wang,D.F.Reilly,T.C.Peck,et al.Move-box:Democratizing mocap for the microsoft rocketbox avatar library.In 2020IEEE International Conference on Artificial Intelligence and Virtual Reality (AIVR),pp.91–98.IEEE,2020.[10]M.Gonzalez-Franco,E.Ofek,Y .Pan,A.Antley,A.Steed,B.Spanlang,A.Maselli,D.Banakou,N.Pelechano G ´omez,S.Orts-Escolano,et al.The rocketbox library and the utility of freely available rigged avatars.Frontiers in virtual reality ,1(article 561558):1–23,2020.[11]M.Gonzalez-Franco,A.Steed,S.Hoogendyk,and ing facialanimation to increase the enfacement illusion and avatar self-identification.IEEE transactions on visualization and computer graphics ,26(5):2023–2029,2020.[12] A.Hartholt,D.Traum,S.C.Marsella,A.Shapiro,G.Stratou,A.Leuski,L.-P.Morency,and J.Gratch.All Together Now:Introducing the Virtual Human Toolkit.In 13th International Conference on Intelligent Virtual Agents .Edinburgh,UK,Aug.2013.[13] E.Kokkinara and R.McDonnell.Animation realism affects perceivedcharacter appeal of a self-virtual face.In Proceedings of the 8th ACM SIGGRAPH Conference on Motion in Games ,pp.221–226,2015.[14] C.O.Kruzic,D.Kruzic,F.Herrera,and J.Bailenson.Facial expressionscontribute more than body movements to conversational outcomes in avatar-mediated virtual environments.Scientific Reports ,10(1):1–23,2020.[15]b.[16] C.minow.Salsa LipSync.https:///unity-3d/lip-sync-salsa/,2022.Accessed:2022-01-13.[17]Oculus.Oculus Lipsync for Unity Development.https://developer./documentation/unity/audio-ovrlipsync-unity/, 2022.Accessed:2022-01-13.。
基于Microsoft Speech SDK和OGRE的语音驱动三维面部动画研究
![基于Microsoft Speech SDK和OGRE的语音驱动三维面部动画研究](https://img.taocdn.com/s3/m/ef264d4fa8956bec0975e3e8.png)
3 X ML表情标签
Mi c ms o f S p e e c h S D K可以解析符 合超文 本标记语 言 的 XML格 式文件 . 用 于文本信息输入 . 我们 在其原有标签基础上增加 了表情标 签< f a c i a l > < / f a e i a l > .由于 O G R E的面部动画提供 了一个具有 ” s a d ” 、 ” h a p p v ” 、 ” ma d ” 三个维度的表情模型 , 我们亦为添加的表情标 签设 置了 三个 属性" s a d ” 、 ” h a p p y ” 、 ” m a d ” , 并 且每个 属性的取值范 围为 0 — 1 0 ,如下 :
0 引 言
1 系统原理与结构
语音 驱动三维面部系统 . 主要包括逻辑分析器 、 1 T r S引擎 、 动 画合 成器等多个模块 .能够对于输入 的 X ML格式汉语文本提供 T T S语音 输 出以及生动的 二 : 维动画 同步 . 本系统基于 Mi c r o s o t f S p e e c h S D K 5 . 1 和O G RE三维渲染引擎 .下文对系统实现的关键技术给出了描述 . 系 统流程图如图 1 所示 。
本 系统基于 M i c 1 " O s o f t S p e e c h S D K 5 . 1 . 该S D K提供 了一套语 音识 别( s R ) 和语音合 成r r r s ) 系统 接 口, 完 全支持简体 中文语 音系统 的开 基于语音驱动 的三维 动画技 术是当前计算机 图形学 以及 虚拟现 发。 它基于 C O M标准开发 , 使程序设计人员从复杂的语音技术细节中 实领域 的研究热点之一 . 九十年代末 期 . 基于英文文本 的语音 驱动的 解放 出来 .仅需面 向逻辑问题即可使用 S D K中的资源开发语音识别 口型动画技术得到的迅速 的发展 . 随后该技术在汉语语音驱动动画技 ( s R ) 和语音合成( 1 T r s ) 的应用程序 , M i c r o s o t f S p e e c h S D K 5 . 1 结构如图 术领域也得到了广泛的应用 语音驱动三维动画技术 . 将 口型动画参 2所示 。 数 和表情动画参数分离为两个正交分量。 在汉语 口型动画领域哈尔滨 2 . 2 O G R E三维渲染 弓 1 擎简介 工业 大学 、四川大学等在 1 3型实时模拟技术方面取得 了较好的成果 . O G R E f O b i e c t — O i r e n t e d G r a p h i c s Re n d e i r n g E n g i n e )是 一 个 基 于 但都 是基于静态人脸模型数据库实现 . 其方法在实际虚拟现实产品开 c + + 的面 向对 象的商业级 的 3 D渲染引擎 . O G R E拥有 良好 的内部构 发中应用 的难度较大 本文以 Mi c r o s o t f S p e e c h S D K提供的 1 v I . S接 口 架. 可 以使研发人 员更容易 、 更 直接地利用硬 件加速 的 3 D图形系统 以及 OG R E的 F a c i a l An i m a t i 0 n模型为基础 . 扩展了 XML标记增加表 开发应用 O G R E对 于底层 的渲染 系统库( D i r e c t 3 D和 O p e n G L ) 提供 情标签并构建 了一个便于复用的准工业级汉语语音 驱动面部动画解 同等支持 . 并且隐藏 了所有细节 . 提供 了一 个基于世界对象和其他直 决 方 案 观类的接 口
OGRE 3D
![OGRE 3D](https://img.taocdn.com/s3/m/2ddb7be2551810a6f52486d8.png)
OGRE支持4种动画: 场景节点动画(SceneNode Animation):每个关键帧都包 含了节点在当前帧的位置、缩放以及方向; 顶点动画(Vertex Animation):每个关键帧都保存了特定 时间的顶点位置数据; 骨骼动画(Skeletal Animation):关键帧保存了骨头位置、 方向以及缩放信息; 数值动画(Numeric Value Animation):每个关键帧中都保 存了相应的数字数据 ; 动画的插值方式包括:线性插值和三次样条插值。
Plugins.cfg列出了ogre 3D启动时应该载入 的所有插件; resources.cfg 列出了启动时需要的所有资 源,比如a 3D mesh, a texture, or an animation; Ogre.cfg 包含了启动ogre所需的一些配置 信息;
场景管理器:在屏幕上显示的所有东西都是由场景管理器 来管理。OGRE里有多种类型的场景管理器。 实体(Entity):一个实体是可以在场景中渲染的物体之一。 在 Ogre 中你不能够直接将一个实体放入到场景中,而是 将实体与场景节点绑在一起,这个场景节点则包括了实体 的方位信息。
AnimationState represent a single animation and its associated information. Each entity stores all the animations it has and we can query them using a string identifier and getAnimationState().
顶点动画(Vertex Animation):保存顶点的快照来决定网 格形体如何变化。包括以下两种动画:
AE中的角色绑定和骨骼动画技巧让角色动作栩栩如生
![AE中的角色绑定和骨骼动画技巧让角色动作栩栩如生](https://img.taocdn.com/s3/m/3f587b60492fb4daa58da0116c175f0e7cd11917.png)
AE中的角色绑定和骨骼动画技巧让角色动作栩栩如生角色绑定和骨骼动画技巧是使角色动作栩栩如生的重要制作方法。
在Adobe After Effects(AE)中,我们可以使用角色绑定和骨骼动画技巧来创建逼真的角色动画。
下面是一些在AE中使用角色绑定和骨骼动画技巧的步骤和方法。
1.准备工作在制作角色动画之前,首先需要准备好所需的素材。
这包括角色设计和素材图像或视频。
确保这些素材具有清晰、高分辨率的质量。
2.制作角色使用适合的工具,如Adobe Illustrator或Adobe Photoshop,制作角色的各个部分。
将每个部分分开,以便后续的角色绑定。
3.角色绑定技巧选择“角色绑定”工具,然后在每个角色部分上创建关键点。
这些关键点将成为角色的连接点。
通过将其连接起来,就可以使角色部分以动画的形式移动。
4.设置骨骼为角色的每个部分设置骨骼。
骨骼类似于实际人体的骨骼,它们连接起来形成一个层次结构。
在AE中,可以使用“Null”层来模拟骨骼。
5.骨骼动画技巧通过控制骨骼的位置和旋转来创造角色的动画。
可以为每个骨骼设置关键帧,然后调整它们的位置和旋转角度,以产生平滑和逼真的动作。
使用AE的“图层动画”选项可以更容易地制作骨骼动画。
6.添加细节和变化为了使角色动画更加生动和有趣,可以添加额外的细节和变化。
这可以包括物体的形状或颜色的变化,或者是角色的表情和姿势的改变。
这些细节和变化将增加角色的动画效果。
7.动画过渡和流畅性为了使角色的动画更流畅,可以添加过渡效果和中间帧。
通过在关键帧之间添加过渡效果,可以让动画更加平滑。
使用AE的“复制帧”和“变形”选项可以很容易地创建这些过渡动画。
8.调整和完善动画9.导出和应用动画当动画制作完成并调整完毕后,可以将其导出为所需的格式,并应用到适合的场景中。
可以将角色动画应用于视频、网页或其他媒体项目中。
OGRE简介.ppt
![OGRE简介.ppt](https://img.taocdn.com/s3/m/0ead6c54ce2f0066f433223e.png)
OGRE的开发可以添加新的场景优化算法对特定 场景进行优化。这一过程不需要修改上层应用 程序。
SceneManager-场景节点
第一个放入场景的节点,必须挂到根节点上面,然后再不断挂接扩充。
纹理管理器(TextureManager) 网格管理器(MeshManager) 骨骼(Skeleton)、GPU程序、材质、字体。。。
游戏程序一般通过调用addResourceLocation将资源 位置信息传递给资源组管理器,由OGRE系统根据 资源类型使用相应的ResourceManager
Root::initialise初始化后,通过调用 Root::getRenderSystem()获取
游戏程序通常不直接操作RenderSystem对象。 游戏程序操作SceneManager等对象,由 SceneManager调用RenderSystem对象
SceneManager 对象
SceneManager控制着由OGRE引擎绘制的场景中 的所有内容,组织创建管理所有的
OGRE DirectX OpenGL Windows、Linux、Mac
部分资料来自/wiki
核心对象(1/2)
核心对象(2/2)
根(Root)对象:OGRE系统的“入口”,用来创建 OGRE系统中的所有基础元素
场景管理库
场景中有哪些内容,以及它们是如何组织在一起的
资源管理库
Mesh也是一种资源,由MeshManager管理。Mesh 的数据结构是OGRE自己定义的一种数据结构,这 些结构通常被存放在后缀名为“.mesh”的文件中
角色动画原理
![角色动画原理](https://img.taocdn.com/s3/m/79ef5acd102de2bd960588fe.png)
角色动画原理现代的游戏都是以一些角色为中心,通常是人物或是动物,角色想要看上去栩栩如生,就必须拥有流畅的,有机的移动效果。
为解决此问题,产生了多种解决方案,如最早的序列帧动画,到最新的蒙皮动画,接下来我们了解一下他们各自的原理以及优缺点。
1.精灵动画精灵动画(Sprite Animation)是一种电子版的序列帧动画,它的诞生起源于最早期的卡通动画,既快速的连续的播放不同的画面,来产生角色的动态效果,就像电影胶片一般,通过快速切换来产生动画效果。
所谓精灵,就是一张张大小相同的位图。
通常我们使用带有透明通道的图片格式保存,每一个区域都代表这个精灵在某一静止时刻的动作体现。
下图展示了一个精灵动画的图像:图1精灵动画位图通常这组序列帧被设计为可重复循环播放,用来模拟一个运动周期,比如人物的行走奔跑等循环性的动作。
获取精灵动画的位图资源之后,在程序中只需将资源按单个动作图像大小进行切割,并存于数组中,在程序循环中根据时间的改变,顺序的循环显示不同的精灵动作,就可以实现出角色的动画效果。
这种动画技术的优点是通俗易懂,使用简单。
缺点是一套动作通常需要很多动作片段组成,占用磁盘空间大,完全没有可扩展性。
虽然它有如此多的缺点,但时至今日,在许多游戏中,仍然能看到它的身影。
在某些特殊情况下,精灵动画的方案仍是首要选则。
2.刚性阶层动画随着三维技术的出现,精灵动画已经不能满足高仿真角色动画的实现需求了,无论从开发的效率上,还是所呈现的效果的角度,需要一种新的技术来解决这些问题,这种新技术就叫做刚性阶层动画(Rigid hierarchical animation)。
在此方法中,一个完整的角色由多个刚性部分组合而成,比如人形角色一般会拆分成左右上手臂、左右下手臂、躯干,头部、左右大腿,左右小腿等部位。
这些部位通过层级的形式互相约束,类似于人体的骨骼,是互相关联的,这样能产生比较真实的角色动画效果,下图是人类足部动画的示例图片:图2刚性阶层动画通过设定不同时刻,某一骨骼的旋转数据,可以快速的模拟出简单的人类角色动画。
metahuman face_animbp解析
![metahuman face_animbp解析](https://img.taocdn.com/s3/m/c7dd1f496d85ec3a87c24028915f804d2a168760.png)
Metahuman Face_animBP是一个用于生成人类面部表情的动画蓝图。
它通常用于游戏开发和虚拟现实应用程序中,以实现更真实的角色表现。
这个蓝图包含了一系列的骨骼变换、肌肉变形和皮肤纹理等参数,可以通过调整这些参数来改变角色的面部表情。
要解析Metahuman Face_animBP,你需要使用一个支持Blueprints的编辑器,如Unreal Engine或Unity。
以下是在Unreal Engine中使用Metahuman Face_animBP的基本步骤:
1. 打开Unreal Engine编辑器,创建一个新的项目或打开一个现有项目。
2. 在内容浏览器中,找到你的Metahuman Face_animBP蓝图文件(通常位于`Content/Animation/AnimStates`目录下)。
3. 将Face_animBP蓝图拖放到场景中的一个角色上,或者将其添加到角色的Anim Blueprint中。
4. 在角色的Anim Blueprint中,你可以看到一个名为`Get Face Animation`的节点。
将此节点连接到一个输出引脚,以便在运行时获取面部动画数据。
5. 你可以使用`Set Face Animation`节点来设置角色的面部表情。
为此,你需要创建一个包含所需面部表情数据的数组,并将其连接到`Set Face Animation`节点的输入引脚。
6. 运行场景,你应该能看到角色的面部表情根据你设置的数据发生变化。
OGRE的骨骼动画系统
![OGRE的骨骼动画系统](https://img.taocdn.com/s3/m/69c4b4e4f80f76c66137ee06eff9aef8941e4879.png)
Ogre的骨骼动画系统UMLSkeleton类:骨骼(骨架)类,骨架包含了一系列的骨头bone对象,负责管理bone对象的生命并将它们以树形结构组织。
骨架对象还包含了一系列该骨架特定对应的动画对象(Animation),Animation对象用来驱动bone对象,使得骨架可以做出不同的动作,然后骨架带动蒙皮网格,使得整个角色模型做出动作。
使用骨架来驱动模型做动画的好处是需要存储的动画数据量比较少(不用向顶点动画那样存储所有顶点每一帧的动画数据),而且骨骼动画可以很方便的将多个动画混合在一起:例如,一边走路一边环视或者一边跑步一边射击。
骨骼动画可以在各个动画切换的过程中使用较少的计算量完成平滑的变换。
骨骼动画的数据存放在.skeleton文件中。
Bone类:骨骼动画中代表一块骨头(也可以被认为是关节jiont),它包含了位置和旋转信息并以树状层次组织,对一个骨骼的三维变换也将作用于它的子骨骼。
在建模的过程中,模型上每一个顶点都会(通过标记上骨头ID)被对应上一块或者多块骨头,当对应的骨头移动的时候,这个顶点也会被移动。
如果一个顶点被对应上多块骨头时,这个顶点还必须针对每一块骨头赋予一个权重,这个权重会指出这块骨头对这个顶点的影响程度,一个顶点被赋予的权重总和应该为1,指定正确的权重可以防止动画过程中的撕裂现象。
Animation类:代表了一个动画序(跑/走/跳..........)。
一个动画序列中可能包含多种类型的动画(NodeAnimation/VertexAnimation代表了不同的动画实现方式),每种类型的动画都包含多条动画轨(AnimationTrack),每一条动画轨存放了驱动一个动画对象进行动画所需的数据,Animation类本身是针对某一种对象使用动画的接口类,提供了对各种对象(Node/V ertex)作用动画的接口(apply(XXX))。
Animation类将动画轨存放在一张表中,以ID作为标识。
基于Kinect的人脸表情捕捉及动画模拟系统研究
![基于Kinect的人脸表情捕捉及动画模拟系统研究](https://img.taocdn.com/s3/m/982a3dce7e192279168884868762caaedd33ba18.png)
基于Kinect的人脸表情捕捉及动画模拟系统研究何钦政;王运巧【摘要】The technical of 3D human facial expression animation is a subject which has potential application and fatal research significance. This paper proposes a facial expression animation solution based on Microsoft Kinect device after the research of existing facial expression capture technology and animation synthesis technology. First, Kinect device is used to capture the face data and relevant expression parameters are extracted, at the same time, a three-dimensional model of face is reconstructed with Autodesk Maya animation software. Then the model is imported to OGRE animation engine and the expression parameters transferred to OGRE in which real time facial expression animation is rendered at last. Experiment results show that the method can provide an acceptable and reliable real-time facial expression animation. Compared to other existing facial expression animation technologies, the system is easier to operate with rather inexpensive device.%三维人脸表情动画技术是一个具有巨大应用前景和研究意义的学科方向。
AE人物动画制作技巧大全
![AE人物动画制作技巧大全](https://img.taocdn.com/s3/m/34d966d54bfe04a1b0717fd5360cba1aa8118c9e.png)
AE人物动画制作技巧大全AE(Adobe After Effects)是一款功能强大的动画制作软件,被广泛应用于影视制作、广告设计和特效制作等领域。
在使用AE制作人物动画时,以下是一些实用的技巧和教程,帮助您更好地掌握AE的人物动画制作。
一、人物绘制与切分在制作人物动画之前,首先需要绘制好人物角色,并将其按照不同部位进行切分,以便后续的动画制作。
可以使用AI(Adobe Illustrator)软件进行绘制和分层,然后导入AE进行后续的动画处理。
二、关键帧动画关键帧动画是AE中最基本也是最常用的动画制作方法之一。
在AE的时间轴中,通过对不同属性的数值进行关键帧的设置,可以实现人物的各种动作效果。
可以分别设置人物的位置、旋转、缩放等属性,并在不同的时间点设置关键帧来控制人物的动画。
三、使用形状图层和蒙版效果AE中的形状图层和蒙版效果可以用来制作更加复杂的人物动画效果。
通过创建形状图层,并在其上应用蒙版效果,可以实现人物的部分遮挡和出现效果。
这个技巧可以用来制作人物的转身、变换和透明等效果,增加动画的变化和层次感。
四、使用骨骼工具AE中的骨骼工具(Duik插件)可以使人物的动画制作更加简单和流畅。
通过对人物角色的切分部位进行绑定和连接,可以实现更加自然和灵活的动画效果。
骨骼工具可以用来制作人物的走路、跳跃和舞蹈等复杂动作,提高动画的真实感和表现力。
五、使用表达式表达式是AE中的一种高级技巧,通过对属性数值的表达式设置,可以实现更加复杂和智能的动画效果。
例如,可以通过表达式实现人物的呼吸效果、眨眼效果和随机动作效果。
使用表达式可以使人物动画更加生动和具有个性。
六、使用插件除了AE自带的功能,还可以借助第三方插件来扩展AE的人物动画制作能力。
例如,使用Trapcode Particular插件可以实现人物的粒子效果,使用Video Copilot的Element 3D插件可以实现人物的三维效果。
选择适合的插件可以提高人物动画的质量和效果。
Ogre中的动画混合(AnimationBlender)
![Ogre中的动画混合(AnimationBlender)](https://img.taocdn.com/s3/m/7b913a68a45177232f60a2be.png)
Ogre中的动画混合(AnimationBlender)网上Ogre的中文资料真的是很少啊,把自己学到的分享出来,希望能对初学者有所帮助。
Ogre中实现骨骼动画真的是再简单不过了,就两个函数:getAnimationState,addTime。
OK,人物就可以动起来了。
这个AnimationBlender类可以实现以多种方式从一个动画淡入到另一个动画,来自于Ogre网站上的一篇文章。
但那位老外只贴出了代码,没有讲解,甚至代码中也没有详尽的注释,像我这样的菜鸟就只能慢慢品味了。
下面是AnimationBlender类的定义:#pragma once#ifndef AnimationBlender_Incl#define AnimationBlender_Incl#include <Ogre.h>using namespace Ogre;class AnimationBlender{public:enum BlendingTransition //不同的混合方式{BlendSwitch, // 直接切换到目标动画BlendWhileAnimating, // 交叉淡入淡出(源动画比例缩小,同时目标动画比例增大) BlendThenAnimate // 淡出源动画到目标动画第一帧,然后开始目标动画};private:Entity *mEntity;AnimationState *mSource;AnimationState *mTarget;BlendingTransition mTransition;bool loop; //是否循环~AnimationBlender() {}public:Real mTimeleft, mDuration; //持续时间bool complete;void blend( const String &animation, BlendingTransition transition, Real duration, bool l );void addTime( Real );Real getProgress() { return mTimeleft/ mDuration; }AnimationState *getSource() { return mSource; }AnimationState *getTarget() { return mTarget; }AnimationBlender( Entity *);void init( const String &animation );};#endif这里定义了几种混合方式,所产生的不同效果运行后就能看到了。
AE中的角色骨骼动画教程
![AE中的角色骨骼动画教程](https://img.taocdn.com/s3/m/4f3683bee43a580216fc700abb68a98271feac3a.png)
AE中的角色骨骼动画教程在AE(After Effects)中,我们可以使用角色骨骼动画来创建生动的角色动画。
通过使用AE内置的工具和插件,我们可以轻松地给角色添加骨骼,并实现复杂的动作效果。
下面将为大家介绍一些AE中角色骨骼动画的基本教程和使用技巧。
第一步是导入你的角色素材。
可以将角色的各个部分分开导入,例如头部、身体、四肢等,或者你也可以导入一个完整的角色合成。
确保素材的分辨率和帧速率与你的项目设置相匹配。
接下来,选择一个部位来添加骨骼。
点击“工作区”窗口中的“层”按钮,在你要添加骨骼的图层上右键单击,选择“创建”>“形状图层”。
在弹出的对话框中,选择“自由变形”工具。
这将使你能够创建和控制骨骼。
现在,将“自由变形”工具应用到你的图层上。
点击你要添加骨骼的位置,并拖动鼠标来添加骨骼的控制点。
你可以根据需要添加多个骨骼来确保你能够自由控制角色的部位。
一旦你添加了骨骼,你可以使用“选择”工具来调整和移动骨骼的位置。
选择骨骼并拖动它们,调整它们的位置和角度。
你还可以通过点击骨骼上的控制点来旋转和缩放它们。
当你完成了骨骼的设置后,你可以进入关键帧动画模式。
你可以选择一个骨骼,并在时间轴上设置关键帧来创建动画效果。
例如,你可以选择角色的腿,然后在时间轴上的不同帧上设置不同的腿部位置,以实现角色的行走动作。
通过在时间轴上设置多个关键帧,你可以创建出更为复杂的动作。
在动画模式下,你还可以使用AE的其他特效和过渡效果来增强你的动画。
选择你要使用特效的图层,然后在“效果与预设”窗口中选择适当的特效。
例如,你可以应用“色彩关键”效果来改变角色的颜色,或者应用“变换”效果来实现角色的形态变化。
除了AE内置的工具和特效,你还可以使用各种第三方插件来扩展AE的功能。
例如,你可以使用Joysticks 'n Sliders插件来添加更流畅的控制器,或者使用Duik Bassel插件来创建更复杂的骨骼动画。
在Blender中制作人物角色的表情动画
![在Blender中制作人物角色的表情动画](https://img.taocdn.com/s3/m/28cfd819580102020740be1e650e52ea5518ce19.png)
在Blender中制作人物角色的表情动画Blender是一款功能强大的三维建模和动画制作软件。
它可以被用来制作各种各样的项目,包括电影、游戏和动画片。
本文将重点介绍如何在Blender中制作人物角色的表情动画。
首先,在开始制作表情动画之前,我们需要一个基础的人物角色模型。
在Blender中,我们可以使用模型库或者自己建模来构建一个人物角色。
确保模型的拓扑结构规整,以便于后续的动画制作。
接下来,我们需要为人物角色添加骨骼系统。
在Blender中,骨骼系统可以通过Armature对象来创建。
选择你的人物角色模型,然后按下Shift+A,选择Armature,再选择Single Bone,就可以在场景中创建一个骨骼。
将骨骼调整到合适的位置,并用Ctrl+P将骨骼与人物模型进行关联。
选择"Automatic Weights"选项,Blender会自动给骨骼添加权重,使其能够控制模型的动作。
现在,我们可以开始为人物角色添加表情了。
在Blender中,表情可以通过形状关键帧来控制。
首先,选择你的人物角色模型,然后在属性编辑器中选择"Shape Keys"选项卡。
点击"Add Shape Key"按钮,在下拉菜单中选择一个表情的名称,比如"笑脸"。
然后,通过移动顶点、缩放或旋转等操作,调整模型的形状,使其呈现出笑脸的表情。
在完成调整后,点击"Key"按钮,将表情保存为关键帧。
通过添加多个不同的表情,我们可以创建一个完整的表情动画。
在Blender中,可以使用时间轴来控制动画的播放时间和顺序。
通过添加关键帧和调整关键帧之间的插值,我们可以实现平滑的过渡效果。
在制作表情动画时,注意保持流畅的过渡和合理的动作。
通过观察真实生活中人物的表情和动作,可以更好地理解和模拟。
此外,可以使用Blender中的镜头视图和渲染功能,预览和渲染出最终效果。
AE中的人体轮廓识别技术
![AE中的人体轮廓识别技术](https://img.taocdn.com/s3/m/f32c5867302b3169a45177232f60ddccdb38e663.png)
AE中的人体轮廓识别技术Adobe After Effects(简称AE)是一款专业的视觉特效和动态图形合成软件,被广泛应用于电影、电视和广告制作中。
在许多项目中,人体的轮廓识别是一个重要的技术,它能够使得特效和动画更加逼真和生动。
本文将介绍AE中的人体轮廓识别技术以及如何应用这一技术来创建令人惊叹的效果。
在AE中,我们可以使用一种叫做“Rotobrush”的工具来实现人体的轮廓识别。
首先,我们需要将所需的素材导入AE中,并将其拖放到新建的合成文件中。
然后,在图层面板上单击右键,选择“Rotobrush”选项。
接下来,我们需要用笔刷工具勾画出人体的大致轮廓。
AE会自动识别轮廓,并将其填充为红色。
完成轮廓的绘制后,我们可以使用Rotobrush工具进行细化和调整。
在工具面板中,可以调整笔刷的大小和硬度,以便更精确地勾画轮廓。
另外,我们还可以使用“+”和“-”按钮来增加或减少轮廓的面积。
工具栏下方还有一个“Refine Edge”选项,可以进一步优化轮廓的细节,使其更加真实。
完成轮廓的细化后,我们可以使用各种AE的特效和动画功能进行创作。
例如,我们可以通过调整图层的不透明度来制作人体缓慢显现的效果。
在图层属性面板中找到“Opacity”选项,可以通过关键帧来控制图层的透明度变化,从而实现人体的逐渐出现或消失。
另一个有趣的应用是将人体与其他图层进行融合和交互。
例如,我们可以使用蒙版功能,将人体的轮廓与背景的特定区域重叠,并通过调整图层属性来实现交互效果。
此外,还可以使用AE的粒子系统,给人体轮廓添加火焰、星尘等特效,增加动感和神秘感。
除了基本的轮廓识别,AE还提供了一些高级的人体识别技术。
例如,可以使用“Motion Tracker”功能,追踪人体在视频中的移动轨迹,并将特效与之同步。
这对于制作追踪镜头特效和物理模拟效果非常有用,例如创造一个人体悬浮在空中的场景。
使用AE中的人体轮廓识别技术,我们可以创造出许多令人惊叹的动态效果。
AE角色动画与骨骼运动技巧
![AE角色动画与骨骼运动技巧](https://img.taocdn.com/s3/m/514e9d5154270722192e453610661ed9ad5155c0.png)
AE角色动画与骨骼运动技巧AE(Adobe After Effects)是一款常用于视觉特效和动态图形制作的软件,它在各类影视、广告、动画制作中起着重要的作用。
在AE中,角色动画和骨骼运动是非常常见的特效制作技巧。
本文将直入主题,介绍AE中的角色动画和骨骼运动技巧。
首先,我们需要了解骨骼运动的概念。
在AE中,骨骼运动是指为2D角色添加骨骼结构,并通过骨骼控制角色的动作。
与传统的逐帧动画相比,骨骼运动更加灵活高效,能够快速制作出生动的动画效果。
在AE中进行角色动画,首先需要准备好所需的素材。
可以使用AI (Adobe Illustrator)等矢量软件绘制角色的身体部分,并将其导入到AE中。
然后,我们需要为角色添加骨骼。
在AE的“工作区”中,选择“新建”-“骨骼工具”,然后在画布中拖动绘制骨骼结构。
接下来,我们可以通过调整关键帧和路径来实现角色的动作。
选择骨骼工具,点击角色的骨骼部分,在时间轴上创建关键帧,并在不同的帧数下调整角色的姿势。
通过在路径上添加关键帧并调整路径,还可以实现角色的移动和轨迹控制。
此外,在AE中我们还可以应用一些高级技巧来增强角色动画效果。
例如,使用“运动模糊”效果可以模拟出快速动作时的模糊效果,使动画更加真实。
使用“变形”工具可以对角色的身体部分进行形变,使其更加丰满生动。
使用“摄像机”工具可以实现逼真的三维位移效果,增加动画的层次感。
此外,在AE的“动画”菜单中还有其他一些实用的动画控制属性,如“缩放”、“旋转”、“位移”等,它们可以进一步调整和优化角色动画效果。
掌握这些属性的使用方法,可以让我们更加灵活地调整角色的动作和外观。
总结起来,AE是一款强大的角色动画和骨骼运动制作软件。
通过使用AE提供的骨骼工具和动画控制属性,我们可以快速制作出生动逼真的角色动画效果。
当然,除了骨骼运动技巧外,AE还有许多其他功能和特效可供探索和应用。
希望本文能为读者提供AE角色动画与骨骼运动技巧方面的参考和帮助。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
OGRE中的人脸动画
[前言:在Ogre的Facial Demo中采用了顶点动画(确切点说是Pose Animation)让面部产生面部表情及发音动画,本文简单介绍了顶点动画的概念,并结合Facial Demo,探讨如何实现Pose Animation。
]
顶点动画是直接使用顶点让网格(mesh)产生动画的一种方式。
每一组动作在顶点动画中对应一个顶点数据实体。
顶点动画被存储在.mesh文件中,因为它与网格的顶点紧密相连。
实际上,顶点动画分为两种子类型。
1、Morph Animation(变形动画)
变形动画依靠在每个关键帧中及其之间保存和插入顶点绝对位置的快照(snapshot)。
当骨骼动画不能恰当处理动画对象时,变形动画会比较有用。
在分物体必须从根本改变动画部分的结构和形状时,骨骼动画就不适合了。
由于绝对位置数据的使用,不可能在同样的顶点数据中混合多于一个的变形动画;如果你想使用动画混合,你应该使用骨骼动画,因为它更有效。
如果你激活了在同一个顶点数据中包含的多个动画,只有最后一个有效。
也就是说动画状态的"weight"选项不能被用于变形动画。
变形动画与骨骼动画能够组合应用(参考Ogre Manual 8.3.3 Combining Skeletal and Vertex Animation)。
同时,变形动画也能在使用顶点渲染器(shader)的硬件中实现(参考Ogre Manual Morph Animation in Vertex Programs)
2、Pose Animation(姿态动画)
姿态动画允许将多个潜在地不同效果等级的顶点姿态(vertex poses)混合成最终的顶点状态。
该动画通常用于面部动画,在这种动画中每一个面部表情被作为一个独立的动画,我们可以将一个表情混合在另外一个上,如果每个姿态只影响面部的一部分,也可以组合所有的表情。
为了产生姿态动画,需要引用预先包含在mesh中的一套动作集,这些动作集采用与源顶点的偏移量来表示。
但是并不要求每一个顶点都有偏移量,当用软件处理这些数据时,没有偏移量的顶点会被忽略掉。
如果用硬件处理的话,没有偏移量的顶点会自动被填充为0。
一旦定义好了姿态,你就可以在动画中引用他们。
每一个姿态动画迹(pose animation track)对应着一个单独的几何数据集合(或者是与物体网格对应的,或者是其中一个子网格的),在动画中的每个关键帧可以引用一个或多个姿态(pose),且每一个有其相应的影响值(influence)。
你能定义许多关键帧,使用多种姿态的混合,从而产生多个部位协调运动的动画。
应该小心多个姿态同时应用的情况。
当在硬件中处理姿态动画的时候(参考Ogre Manual Pose Animation in Vertex Programs),每个激活的动作都需要额外的顶点缓冲器加入到渲染器(shader)中,如果采用软件来处理动画,你处理的激活姿态越多消耗的时间也就越长。
也就是说,在一个关键帧中如果有两个姿态,在下一帧中也有两个,那么在它们过渡之间实际上就有4个激活的关键帧。
你可以综合应用姿态动画和骨骼动画,参考Ogre Manual 8.3.3 Combining Skeletal and Vertex Animation,你也可以采用硬件加速那些混合顶点渲染器(shader)的应用程序(参考Ogre Manual Pose Animation in Vertex Programs)。
3、Pose Animation xml结构
// 顶点缓冲器内容
// 主要是为pose和animation提供索引号
// 这些参数主要是对手调动画有效
// 下面这些动画对于自动播放动画有效
// 动画迹
// 关键帧
4、如何实现
4.1 建模工具对Pose Animation的支持
Facial Demo中所用的头部模型是由SoftImage授权使用的XSI面部动画模型,不是所有的导出工具都支持Pose Animation,目前有SoftImage XSI 5.0 Exporter v1.2.3、oFusion Pro for 3ds max、Maya Ogre导出器支持。
4.2 关键顶点的寻找
通过分析xml中的poseoffset偏移量,可以看到许多非常小的数据,这些数据是由模型导出工具产生的,其实它们完全可以被忽略掉。
通过实验,我将原来604个顶点的poseoffset数据减少为75个,而且效果和原来相差不大,说明这75个poseoffset对应的顶点是该动画的关键顶点。
4.3 在程序中如何读取Pose Animation
下面是包括在场景创建函数createScene中创建动画的代码:
// 载入包含pose animation的mesh
MeshPtr mesh = MeshManager::getSingleton().load("aaa.mesh", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
// 创建动画将其命名为smile,并将长度初始化为0
Animation* anim = mesh->createAnimation("smile", 0);
// 创建顶点动画迹,这里只有针对索引值为0的Pose动画,故第一个参数为1[1]
// 这些动画pose被定义在标签中
VertexAnimationTrack* track = anim->createVertexTrack(1, V A T_POSE);
// 创建手动动画,并将关键帧起始位置置为0
manualKeyFrame = track->createVertexPoseKeyFrame(0);
// 创建手动动画所用到的poses引用,并初始化为0
manualKeyFrame->addPoseReference(0, 0.0f);
// 创建物体(这里是Dr. Bunsen的头像)
Entity* head = mSceneMgr->createEntity("Head1", "aaa.mesh");
// 从mesh中得到名为action的动画参数(在标签中定义)
actionAnimState = head->getAnimationState("action");
// 是否允许自动播放该动画
actionAnimState->setEnabled(true);
// 获取先前从mesh文件中得到的动画smile,并将关键帧起始位置置为0 manualAnimState = head->getAnimationState("smile");
manualAnimState->setTimePosition(0);
下面在是每一帧渲染开始都会调用的frameStarted函数中自动播放动画代码:// 根据自上一帧以来所消耗的秒数来修改调整关键帧位置actionAnimState->addTime(evt.timeSinceLastFrame);。