已阅读5页,还剩41页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Rigging for Realistic Movement绑定角色动画Your zombie is looking great, but if you were to put it into Unity now, you would not be able to animate it. Animation is the last step in creating a believable character as well as one of the most complex parts of the 3D art process. To animate your zombie, you will need to rig it with an armature. In this chapter, you will explore the rigging process by building your own rig, linking it to the zombie, and weight-painting the zombie so it moves properly.你的僵尸看起来很好,但现在还不能够导入到Unity,它还没有动作。动画是3D软件创建角色的最后最复杂的一步。要制作僵尸的动画,你将需要使用一个骨架来绑定它。在本章,你将研究绑定的过程来建立你自己的绑定装置连接到僵尸,然后绘制权重使它们它更适合动画。This chapter covers the following topics: 本章包含以下内容: Understanding rigging 了解绑定 Creating a simple armature 创建一个简单的骨架 Finishing the armature with constraints 使用约束完成骨架 Linking the armature and zombie 连接骨架和僵尸Understanding Rigging 了解绑定Now that youve created your color map in a digital painting program, you can return to Blender and begin to rig your zombie. Rigging is the process of building an armature and linking it to a mesh. An armature acts much like the wire skeletons of claymation charactersthe audience sees the clay outside, but the animator is actually moving and posing a metal armature inside the clay. Working with armatures is an integral part of turning a character mesh into an interactive game asset, because it allows characters to move and pose realistically (Figure7.1).现在你已经在绘画软件创建了你的颜色贴图,你可以返回到Blender开始绑定你的僵尸。绑定是创建一个骨架然后连接到网格的过程。骨架的作用很像观众在外面看到的粘土动画的角色的金属支架,粘土动画实际上是移动和改变粘土里面的金属支架的姿势。使用骨架工作是将一个角色的网格转换成交互的游戏角色,因为它允许角色移动和摆出真实的姿势。Figure7.1 Rigging allows you to pose characters in any way you wish.Whereas Chapter 5, “Sculpting for Normal Maps,” and Chapter 6, “Digital Painting Color Maps,” dealt with work similar to more traditional art, this chapter once again enters the realm of technical art. Indeed, creating a rig is perhaps one of the most technical parts of the 3D asset creation process.而第5章“雕刻的法线贴图”和第6章, “颜色贴图的数字绘制 ”处理类似比较传统的艺术作品,本章再次进入技术的境界。事实上,创建一个绑定也许是创建3D资源过程最有技术的部分。Rigging is not just a process of making a model movable; it involves precisely naming and organizing the relationships between parts of the rig, called bones. Bones can be set to interact with specific vertices in a mesh so that when the rig is posed, the mesh follows. Bones can also be given constraints in how they move and interact with one another. These constraints give bones specific behaviors that allow for a variety of animation possibilities. In this way, understanding proper rigging techniques will put you on the path to creating a myriad of visually compelling animations.绑定不仅仅是一个制作模型可动的过程;它包括了正确的命名和组织绑定各部分之间的关系,叫骨骼。Bones能够设置为和一个网格的某部分的顶点交互,使得网格跟随绑定的运动。骨骼也可给出它们如何移动,并彼此相互作用的约束。这些限制使骨骼的特定行为,使其适用于各种动画的可能性。通过这种方式,了解正确的绑定技术将会使你踏上创造无数的引人入胜的动画道路。Like the differences between modeling for animations and games, however, differences exist between models built for animations and those built for real timerendered environments.像动画和游戏建模之间的差异,然而,为动画创建的模型绑定和这些为实时渲染环境建造的绑定之间是存在差异。Animation Rigs vs. Game Rigs 动画绑定对决游戏绑定Like models, rigs have their own sets of limitations when being used for games instead of traditional animation. Like animation models, animation rigs can be complex and feature more parts than their videogame counterparts. The Rigify add-on introduced in Blender 2.5 is an example of such a rig (Figure7.2).像模型,绑定有它们自己的限制被用于游戏而不是传统的动画时。像动画的模型,动画绑定可以很复杂,比起它们的游戏绑定有更多的功能。Blender 2.5引入的插件Rigify就是重要的一个如此复杂的例子(图7.2)。Figure7.2 Our zombie rigged with RigifyFigure7.2 shows what the zombie looks like rigged with the Rigify armature. This fully featured rig has hundreds of bones and is capable of creating some excellent animations with simple commands. It is also prebuilt, so animators do not have to go through the hassle of creating their own custom rig. However, there is a definite drawback to using this armature for game characters.图7.2显示的僵尸看起来像是用Rigify骨架绑定的。这个全功能的绑定有数百根骨头和能够使用简单的命令创建优秀的动画。这也是预先建立的,所以动画师不必通过创建自己的绑定。然而,它不适合使用于游戏角色。Figure7.3 shows the zombie in a Unity test file. In the upper-right corner of the screen, the games frame rate is displayed. Frame rate is the speed at which the game plays back onscreen as the user interacts with it. Many games run at between 30 frames per second (fps) to 60 fps. In this particular image, the frame rate is shown at 7.5 fps with four zombies (including the one peeking through the wall) onscreen at once.图7.3显示了僵尸在Unity的测试文件。在屏幕的右上角显示了游戏的帧速率。帧速率是游戏播放屏幕与用户交互的速度。许多游戏是在每秒30帧到60帧之间运行。在这个图像四个僵尸(包含一个通道)屏幕显示的帧速率是7.5 fps。Figure7.3 The Rigify-animatedzombie in UnityCompare this frame rate to the one in Figure7.4, where the frame rate rises to 16 fps while having hundreds of unrigged models onscreen.和图7.4的帧速率比较,图7.4有数百个未绑定的模型的帧速率提高到16 fps。Figure7.4 Unity game screenshot with unrigged zombiesWhat benchmark tests like these show is that complicated animation rigs can drastically reduce the frame rate of videogames much more quickly than polygon counts can. This is why for games much simpler rigs are used.这些基准测试表明复杂的动画比起多边形数可以更快的大幅降低视频游戏的帧速率。这就是为什么游戏要使用简单的绑定。Bone Anatomy and Relationships骨骼解剖和关系Part of the reason that armatures take up so much memory is the information they hold. Not only do they tell the modeling environment and game engine how a mesh should deform, but they also contain information on their relationships with one another.骨架消耗如此多的内存的部分原因它们保存了信息。它们不仅仅告诉模型、环境和游戏引擎网格怎么变形,也包含了它们之间的相互关系的信息。All bones in Blender have three parts: the head (also called the root), the body, and the tail (also called the tip), as shown in Figure7.5. The head/root and tail/tip are both selectable, which will come in handy later in this chapter.Blender所有的骨骼包含三个部分:头部(也叫根部),主体,尾端(也叫尖端),如图7.5所示。头部/根部,尾端/尖端都是可选的,这将在本章稍后派上用场。Figure7.5 Image of a single bone. The head/root is the sphere at the thick end and the tail/tip is located at the thin end.In Blender, bones can be extruded from one another through either the tail/tip or head/root of previously created bones. When a new bone is extruded from the tail/tip of another, it is the child object of the first bone, which is its parent. Parents and children in 3D programs are linked in such a way that child objects follow the transform (position, rotation, scale) and other attributes of the parent. The parent/child relationship will be very important in Chapter 9, “Unity Engine Basics,” when you move to the Unity engine. 在Blender,也可以再以前创建的骨骼的头部/根部或尾端/尖端挤出新的骨骼。当一个新的骨骼是从另一个的尾端/尖端挤出的,它是第一根骨骼的子对象,第一根骨骼是父对象。父对象和子对象是以这样的一种方式来连接的:子对象跟随父对象的变换(位置,旋转,缩放)和其它的属性。在第九章“Unity引擎基础”父子关系是非常重要的。For now, understand that bones also have a parent/child relationship in that child bones will follow the rotation of their parent. For example, later in this chapter you will create an upper arm bone by extruding from the top of the spine. When the spine bone is rotated along the z-axis, the upper arm will follow to create a realistic shoulder movement (Figure7.6).现在,明白了骨骼的子骨骼将跟随它们父骨骼的旋转而旋转的父子关系。例如,在本章后面你会被从脊柱的顶端挤出创建上臂骨头。当脊柱骨沿z轴旋转,上臂将跟随旋转创建逼真的肩部运动(图7.6) 。Figure7.6 Rotating an armatures spine (the parent) forces its children (the arms and head bones) to follow.Beyond their default relationships, bones can also be set up to have constraints in the way they move. These constraints open up a wide variety of possibilities for posing and animation, such as having bones follow or point to one another. One of the most important constraints is inverse kinematics (IK). IK allows the bone at the end of a chain of bones to control the entire chain (Figure7.7).除了它们的默认关系,骨头也可以设置约束这样的方式来限制它们的移动。这些约束开拓了创建种类繁多的姿势和动画方法,如有一些骨骼跟随另一根骨骼的指向。Figure7.7 A chain of bones with IK. Only the orange IK bone is being moved; the rest follow.For example, when posing an arm grabbing an object, the animator would have to pose the individual parts of the arms as they reach out for the object; this is often referred to as forward kinematics (FK). With IK, however, the animator needs to simply grab the hand bone, or whichever bone is set as the IK bone, and bring it to the object. The rest of the arm will follow. 例如,当要摆出一个手臂抓取一个物体的动作,动画师必须单独分别摆动手臂各部分取抓取物体的动作,这常常是正向动力学的做法。对于反向动力学,动画师只需简单的移动手部的骨头或任何一根设置为IK的骨头,到物体。结果是整个手臂都会跟随着运动。Now that you understand how bones relate to and interact with one another, its time for you to learn about how to build an appropriate armature for game characters.现在你了解骨骼关系及相互作用,是时候学习如何为游戏角色建立合适的骨架。Anatomy of an Armature 骨架解剖Unity can give an idea of how an acceptable game rig is built. Like other engines, Unity employs ragdoll physics when creating “dead” versions of character models. Ragdolls are rigs with loose joints that crumple in accordance with the engines physics system (Figure7.8).Unity能够给出如何建立一个可以接受的游戏绑定的想法。像其它的引擎,Unity使用布娃娃物理系统创建一个角色的“死亡”版本。布娃娃系统是根据引擎的物理系统 使角色关节倒下的同时松弛关节装置(图 7.8)。Figure7.8 A ragdoll characterTo create ragdolls, Unity asks for specific bone callouts/names. The list is a useful guide for creating your own rigs, as you can create bones that will correspond with Unitys own armature-related systems (Figure7.9).要建立布娃娃,Unity要求特定骨骼的标注/名字。这个列表指导你创建你自己的绑定是很有用,你能够创建符合Unity自己的骨骼系统的骨骼(图7.9)。Figure7.9 Unitys ragdoll bone listWhile creating your armature according to Unitys list may seem very software specific, the outcome will be a good basic armature that can be used in multiple engines. Furthermore, creating your armature according to Unitys list will allow your model to work as efficiently as possible. The list shows you that armatures should be built according to real body partstheres no need to reinvent the wheel when trying to get realistic animations.虽然你的骨架符合Unity列表也许看起来是为非常特定的软件创建的,但结果是有一个很好的可以在多个引擎很好用的基础骨架。此外,创建你的骨架符合Unity列表可以让你的模型尽可能高效的工作。这个列表显示了你的骨架应该符合真实的身体部分当你试图获得逼真的动画时不用推倒现实存在的东西重来。According to the Unity list, your armature will need a root bone, the bone that acts as a foundation for the rest of the armature, as it will be the parent bone of all the subsequent bones you create. Root bones are typically located in the hips. The list also specifies a bone each to represent the spine and the head. For each of the limbs, it specifies an upper bone, referred to by Unity as the arm or hip, and a lower bone, called the elbow or knee, for each limb. It also asks for a bone to control the hands and feet. 要符合Unity列表,你的骨架需要一个根骨头,充当骨架的其余部分的基础骨头,因为这将是以后的所有创建的骨骼的父骨骼。根骨头通常位于臀部。该列表还指定了每个代表头部和脊椎的骨骼。对于每个四肢,它指定上部的骨骼,被Unity称为手臂或臀部,和较低的骨骼,称为手肘或膝盖,对于每个肢体,它还要求一根骨头控制手和脚。As useful as this list is, it seems a bit limiting. What if you want to animate your painstakingly modeled fingers and facial features? Fortunately, the Unity bone list is a minimum requirement for dead body ragdolls of your models, not a law for all armature creation. As with choosing a polygon count for models, evaluating how important your character is and how much time the player will spend seeing it helps determine what kinds of articulation the character should have. Simpler enemies, even humanoid ones, may not require full hand articulation. Likewise, they may not need full facial articulation if they will not be doing much acting. 这个列表很有用,但它似乎有点限制。如果你想刻意模仿手指和面部特征的动作?幸运的是,Unity列表是你的模型的尸体布娃娃的最低要求,而不是对所有骨架创建的法则。像选择多边形数量那样,评估你的角色的重要性和玩家花费多少时间注视你的角色将有助于你决定角色应该有什么样的关节。简单的敌人,甚至是人形的人,可能不需要全部手关节。同样的如果它们不用做太多的表演都不需要全部面部关节。This chapter will give you the best of both worlds: you will rig your zombie to have an efficient armature based on Unitys specifications while adding bones for posing fingers, facial features, and other structures.本章将让您两全其美的:你的僵尸将绑定基于Unity的规范的有效率的骨架,同时增加摆姿势的手指骨骼,面部骨骼和其它的结构。Creating a Simple Armature 创建简单的骨架Now that you understand rigging a little better, you are ready to begin building the armature for your zombie. 现在你已经对绑定有了大概的了解,可以为你的僵尸准备创建骨架。Beginning the Armature 开始创建骨架Like human bodies, armatures have a central spine from which the other bones extend. You will begin your armature by creating a similar structure. 像人类的身体,骨架有一个其它骨头延伸的中央脊椎骨。你将开始创建一个简单结构的骨架。 1. Open Blender if you have not already done so. Open your own zombie model from Chapter 6, or open the file Ch07_Zombie_ReadyForRigging.blend in the Chapter 7 folder at this books web page, /go/gameblenderunity. 打开Blender,打开你第六章的模型。或打开本书网站/go/gameblenderunity.下载的第七章Ch07_Zombie_ReadyForRigging.blend文件。 2. If you are working with your own file, arrange the screen like the one shown in Figure7.10.如果你是工作在你自己创建的文件,整理文件使它看起来像图7.10.Figure7.10 Setting up a workspace for rigging3. RMB-click to select the zombie model. Press Shift+S to bring up the Snap menu. Select Cursor To Selected to center the 3D cursor at the center of the zombie model. LMB-click to place the 3D cursor near the models groin as close to the zombies central axis as possible. Open the Snap menu again and select Cursor To Grid to ensure the cursor is nicely centered.右键点击选择僵尸模型。按Shift+S调出Snap菜单。选择Cursor To Selected to center,让3D准心在僵尸模型的中心。左键点击放置3D准心到模型的腹股沟处尽量靠近僵尸的中轴线。再次打开捕捉(Snap)菜单,然后选择select Cursor To Grid确保准心完美的在中轴线。 4. Access the Add menu by pressing Shift+A. Hover over Armature in the menu and select Single Bone (Figure7.11). 按Shift+A打开添加(Add)菜单。选择Armature再选择Single Bone(图7.11)。 5. Initially it will appear as though you have accomplished nothing, but there is actually a large bone object inside the model, the tail/tip of which is peeking out the top of the zombies head. To work more efficiently, you will want to turn on the armatures X-Ray setting. This will make bones visible even when hidden by geometry. In the Properties editor, go to the Object Data panel for the armature, which looks like a small stick figure. Once there, move down to the Display panel and check the X-Ray option (Figure7.12). 最初,它看起来就好像什么东西都没有创建,但实际上是由一根大的骨骼在你的模型里面,尾端/尖端朝向僵尸的头部。为了更有效地工作,你将要打开骨架的的X-Ray设置。这确保隐藏在几何体内部的骨骼可见。在属性编辑区窗口,到骨架的数据对象(Object Data)面板看起来像小火柴人的图标。然后向下移动到Display面板勾选X-Ray选项(图7.12 )。Figure7.12 Turning on the X-Ray option6. Now you will want to make the bone a bit smaller so it fits inside the zombies hips. Like models, armatures have Object and Edit modes. Press Tab to enter Edit mode for your new armature, and RMB-click the body of the bone to select the whole thing. 现在,你将要让骨头小点,以适合到僵尸的臀部里面。像模型那样,骨架都有编辑模式和物体模式。按Tab键,进入新骨架的编辑模式,右键点击骨头主体选择整个骨头。For now, press S to scale the bone down to a size that will allow it to fit inside the zombies hips below its belt. When you have scaled the bone appropriately, press Shift+S and select Selection To Cursor from the Snap menu to bring the bone back to the right position (Figure7.13).现在,现在,按S键缩放鼠标向下移动缩小骨骼将使它能够适合到在皮带下的臀部里面。当你有进行适当的缩放骨骼时,按Shift + S ,然后选择捕捉(Snap)菜单的select Selection To Cursor,使骨骼回到正确的位置(图7.13 ) 。Figure7.13 Scaling and centering the armature bone in the zombies hips 7. With this bone still selected, go to the Properties editors Bone panel (click the button with the bone on it) and use the text input panel at the top of the panel to rename the bone Root.仍然使这个骨骼处于选择,到属性编辑区的骨骼面板(点击骨头图标按钮)并在面板顶部的文本输入框面板重命名根骨骼。 8. Select the tail/tip of the Root bone and press E to extrude a new bone from it. Press Z to confine the extrusion along the z-axis. This bone should move about halfway up the back. Perform this operation again to create a bone that extends to the head/root of the neck. Call these bones Spine.01 and Spine.02, respectively (Figure7.14).选择根骨骼的尾端/尖端并按E键挤出一个新的骨骼。按Z键沿着Z轴挤出新骨骼。这跟新骨骼应该朝背面向上移动到一半的地方。再次执行此操作创建一个骨骼延伸到脖子。把这些骨头分别命名为Spine.01 和 Spine.02(如图7.14)。Figure7.14 Adding two bones for the spine 9. Press Numpad 3 to go to the side view. Adjust the bones to better match the zombies anatomy. Bone placement is easily adjusted by selecting the joints between bones and pressing G to move them around (Figure7.15).按数字键3切换到侧视图。调整骨骼以便更好地匹配僵尸的身体结构。骨骼的位置很容易通过选择骨骼之间的关节然后通过按G键移动它们来调整它们的位置(如图7.15).Figure7.15 Adjusting the Root and spine bonesNow you have a simple basis for your armature. Next, you can create the limbs.现在,你的骨架已经有一个简单的基础,接下来,你可以开始创建四肢。Creating Leg Bones 创建腿部骨骼You will begin extruding limbs from the spine bones by creating the legs. This exercise will show you how to use x-axis mirroring and symmetrical extrusions for these simple structures.你将首先从脊椎骨挤出四肢创建腿部。这个练习将告诉你如何使用X轴和镜像对称挤出这些简单的结构。 1. Return to the front view by pressing Numpad 1. Select the tail/tip of the Root bone. If it is not already displayed, open the 3D viewport Toolshelf by pressing the T key. At the bottom of the Toolshelf is the Armature Options panel. Select the X-Axis Mirror check box in this panel. You will be creating the legs and arms now, so this option will let any changes made on one half of the model be reflected on the other side. 按键盘的数字键1返回到前视图。选择根骨骼的尾端/尖端。按T键打开3D视图窗口的工具架。在工具架的底部的骨架选项(Armature Options)面板。勾选这个面板的X-Axis Mirror复选框。现在将创建的腿和手臂,这个选项允许制作半边的模型然后映射到另一边。 2. Back in the viewport itself, press Shift+E to extrude two symmetrical bones from the Roots tail/tip. RMB-click to select one of the new bones and press Alt+P to bring up the Clear Parent menu. Select Disconnect Bone from the menu. Select the head/root of one of the new bones and move it to the zombies hips, and then move the tail/tip down to the knee, as shown in Figure7.16. Try to keep the bones as vertically straight as possible. Rename your new bones Thigh_L and Thigh_R. Try to follow Figure7.16 as closely as possible; otherwise you will have bone roll issues.返回到视图,按Shift+E从根部骨骼尾端/尖端基础两根对称骨骼。选择其中的一根新骨骼然后按Alt+P弹出Clear Parent菜单。选择Disconnect Bone选项。选择其中的一根新骨骼的头部/根部并移动到僵尸的臀部,然后并移动尾端/尖端到膝盖,如图7.16 。尽量保持骨骼的垂直。重命名你的新的骨头为Thigh_L和Thigh_R 。尽可能尝试按照图7.16;否则就会有骨骼滚动问题。Figure7.16 Creating the thigh bonesBone roll is the direction that the bones in a 3D model are facing. When bones are misaligned, this can cause problems with rotation. To fix bone roll, press Ctrl+N
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 江苏省扬州市大丰区第一共同体市级名校2026届中考联考物理试题含解析
- 危重病人血气分析护理要点
- 我国HIV流行现状、防治目标与面临挑战
- 中医外科护理学基础
- 巢湖市2025年三年级数学第二学期期中调研试题(含答案解析)
- 【2026】年味精制作工职业技能鉴定题库及解析(附答案与解释)
- 【代孕儿童的归属争议问题研究10000字(论文)】
- 岳阳市岳阳县2025届三下数学期末教学质量检测试题(含答案)
- 【2026】年铅笔制造工专项题库及解析
- 护理教学质量监控体系
- 中国近现代史纲要-第七章
- MOOC 商务智能-西南财经大学 中国大学慕课答案
- 临床检验危急值培训课件
- (含多场合)离婚协议书打印模板
- 临床实习的基本要求和指导
- 北京版八年级数学下册全册课件【完整版】
- 小鸟科技拼接处理器产品
- 常微分方程一阶微分方程的初等解法公开课一等奖市赛课获奖课件
- 公务用车管理办法
- 全国三维数字化创新设计大赛全国总决赛一等奖
- GB/T 21144-2023混凝土实心砖
评论
0/150
提交评论