|
楼主 |
发表于 2008-2-1 11:40:15
|
显示全部楼层
Simple Unit Tutorial, step 3
基本模型教程,步骤三
Add a UVW Map modifier and fit it to the planar map from the side. You may need to
rotate the UVW Gizmo to the right angle. You can now add an Unwrap UVW to fine-tune
areas like the eyes.
At this point you can preview your work with the Warcraft III Preview. Under the
Utilities Panel chose the Warcraft III Preview and click the button Preview. This
will launch the viewer to look at your model.
If any errors are deteced, they will open in a dialog box showing the warning or a
fatal error,Warnings can indicate a problem, but the Previewer will still try to
display your work. Fatal errors will prevent the launch of Preview. At this time if
something is wrong, go back over the first steps.
为我们的单位添加一个uvw map贴图坐标修改器,并使之在planar平面贴图坐标下从侧面匹配大小。您可能需要把uwv虚拟体往右边少许旋转一点。现在就可以为它添加一个unwrap uvw贴图展开编辑器并对一些地方诸如眼睛进行微调。
这时候您也可以通过魔兽三预览工具对您的模型进行预览。在utilities实用工具面板里选择魔兽三预览工具,点击面板顶端的preview预览按钮,打开预览窗口。如果有错误,会弹出警告或者致命错误之类的窗口。警告表示模型有问题存在,但一般情况下,预览器还是能显示出您的模型。而致命错误则可能导致预览器无法运行。那么您就必须从第一步开始检查是否有关键性的问题。
Setting Sequences
Warcraft III uses “note track” keys in the track view to define animation sequence
length and timing. One 3ds max file includes all sequences for a Unit Model. These
note track keys also define whether the sequence plays one time or loops. The note
track for sequences is always under Objects in the track view. See Animation List of
sequence names for more information.
设置动画片断
魔兽三利用3ds max轨迹编辑器里的“注释轨迹”关键祯来定义动画片断的长度和时间选择。一个3ds max文件包括一个单位模型的所有动画片断。这些注释关键祯也定义了哪些动画是只播放一次还是循环播放。片段的注释轨迹始在轨迹编辑器里终位于“objects”项目之下。后面的参考附录里有魔兽动画列表以及片段的相关信息。
Sequence note track requirements
The sequence name must be identical on the two keys that mark the beginning and end
of a sequence. No other note keys can be between them.
Sequence name requirements
Sequence animation names are one or more word tokens separated by spaces. The
sequence name must be in quotes if it includes multiple tokens. The full sequence
name is made up of primary and secondary name tokens like “Stand Ready”, and these
animations are chosen by the game engine by a best-match method. In the case of a
unit that attacks and then pauses between attacks, the game code will ask the unit to
play the sequence “Stand Ready”. If that animation doesn’t exist, the unit will
fall back to its stand animation. There are numerous possible combinations of
animations, and you can further customize the animation sequence by playing with the
timing of those animations.
片断注释轨迹的要求
片断的名字在标示动画开始和动画结束的两个祯上面必须保持一致。而中间不允许存在任何其他注释祯。
片断名字要求
动画片断名字是一个或多个由空格隔开的字符代号。如果同一片断有多个变化那么名字上必须加上括号。完整的片断名由首要代号和次要代号组成,比如“stand ready",游戏引擎通过一个最佳匹配方式为单位选择动画片断。比如某单位被发布了攻击命令,在每两次攻击动画之间会有一个动画冷却过程,这时候,游戏引擎会命令单位播放“stand ready”动作,而如果这个动画片断不存在,那么该单位将会回到他的默认站立状态。有无数种可能的动画组合,因此您可以通过调整这些动画的时间来自定义动画序列。
Note track options
Comment - Often for reference only, a comment can be added to the name; this comment
is ignored by the game engine. The Warcraft III artists used such comments to name
animation versions by simply adding a space and a dash to the name. All text after
the “–” and still inside the quotes is ignored.
NonLooping – By default, all animations loop. If an animation is to play exactly one
time, the line NonLooping can be added. Attack and spell animations are NonLooping,
since they play one time and then play the stand (or “Stand Ready”) animation
before their cooldown allows them to attack or cast a spell again.
MoveSpeed - The comment movespeed followed by a space and a number doesn’t affect
the model at all, but it is a useful tool in previews, where it will move the ground
grid at that rate to simulate walking. Any value can be used. Most Warcraft III units
have between 250 and 400 movement speed.
Rarity – Warcraft III’s animation choosing system allows you to have multiple
animations with the same name. The animations are randomly chosen. To ensure that
certain animations happen less often, add the line rarity followed by a space and a
single number from 1 to 9. The higher the number is, the less often that animation
will be chosen.
Time Scaled Animations – Certain sequences are given a fixed time so they can be
procedurally altered in playback speed. Birth and decay animations are usually set up
with a sequence length of exactly 1800 frames, or 1 minute. The animations will be
scaled faster or slower by the game engine to equal the build time or decay time
specified for that unit.
注释轨迹选项
Comment注解--通常用作参考,注解能被加入游戏,但执行游戏时将被引擎忽略。魔兽三的艺术家们通常用这种注解为片断名字加上空格或者横杠以区别动画的不同版本。所有横杠后面的文字和括号里面的文字都将被忽略。
NonLooping不循环的--任何动画片断默认都是循环的。而如果有些动画的确只需要播放一次,那么就应该加上“NonLooping”这行。攻击和魔法动画都是不循环的,当单位播放一次这些动画以后,在动画冷却允许第二次攻击或施法之前就必须紧跟站立动画(或者“stand ready"准备就绪动画)。
MoveSpeed移动速度--这个可选指令后面通常根一个空格和一个整数,这个整数并不是代表模型的实际移动速度,而是用于预览的。在预览器中,单位将会以这个数字为频率在地面网格上移动从而形成移动效果。这个数字可以任意给与,但大多数魔兽单位的移动速度在250到400之间。
Rarity稀有性--魔兽三的动画选择系统允许您多个动画共用一样的名字。动画是被随即选取的。为了保证某些动画较少出现,那么可以加上这条指令,并空格加上一个1到9之间的随机数字。数字越大,动画出现的频率将会越低。
Time Scaled Animations--某些动画片断被固定了时间长度以便可以程序地改变播放速度。诞生和腐烂动画片断通常被设置到1800祯,也就是1分钟。特定单位的这些动画片断将会被游戏引擎根据其建造时间或者腐烂时间来快放或者慢放。
Simple Unit Tutorial, step 4 .
基本模型教程,步骤四
Open the track view and add a note track under Objects. The first sequence we need to
make is a walk. Add a key to the note track at frame 10 and another at frame 40. At a
default time scale of 30 frames a second, this will make a one-second walk animation
Select both of the keys and right-click one. In the Notes pop-up, type:
Walk
MoveSpeed 300
Just like figure 10. This will make a walk sequence.
For this Simple Unit we will also need stand, attack, and death sequences. All of
them should be 30 frames in length and have about 20 frames between sequences. Both
attack and death will need NonLooping. If you preview now, nothing will change, and
the sequence will be ignored until the model actually animates. That’s the next
part.
打开轨迹编辑器,在“object”项目下添加一条注释轨迹。行走是我们第一个需要做的动画片断。在注释轨迹的第10祯和第40祯各添加一个关键祯。30祯的间隔一般代表1秒的实际时间,这样我们将创造一段1秒钟的行走动画。同时选择两个祯右键,在弹出的注释窗口里输入:
Walk
MoveSpeed 300
如图10所示,这样我们就创建了一个行走动画片断。
在我们这个教程的例子里,这个单位还需要站立,攻击和死亡动画。所有这些片断最好都有30祯的长度,并且每两个片断之间应该有不少于20祯的间隔。攻击和死亡动画都需要加上“NonLooping”标示无循环的。现在您如果预览模型,没有任何动态,在模型真正有了动画之前,这些片断都会被忽略。
Animating Geometry, Bones and Helpers
Geometry can be directly animated with position, rotation and scale. Animating non-
uniform scaling is not the same as it is in 3ds max unless the origin of the scaling
object is aligned with the world in frame 0. For complex animations we suggest you
make a skeleton and link the geometry to that skeleton.
Acceptable skeleton types
The animating character skeleton can be made of max bones, helpers, and geometry,
such as an editable mesh. Geometry needs to have the “bone” user property flagged,
or it will actually draw the geometry. These bone types need to be unhidden when you
are exporting them. Units should have a bone (or a geometry flagged as a bone) named
“bone_head” and another named “bone_chest”, both of which should be placed in the
skeleton respectively. These are used by the Warcraft III Editor script “Lock body-
part facing”. Likewise, turreted buildings can use “bone_turret” to aim only the
turret at the target.
给物体,骨骼和帮助体做动画
对于多边形体,可以直接为位置、旋转和缩放做动画。除非物体的中心坐标在第0祯时是与场景中心对齐的,否则非等比例的缩放动画将在游戏中出现跟3ds max中不一致的效果。对于复杂的动画,我们建议您创建骨骼并把物体分别链接到骨骼上,利用骨骼创建物体的动画。
可接受的骨骼类型
角色单位的动画骨骼可以使用3ds max内建的骨骼物体,帮助物体,甚至是多边形体。但是使用多边形体的时候必须在用户属性里给它加上骨骼定义,否则它会象正常物体一样在场景中被渲染出来。当您导出模型的时候,您必须让所有骨骼类型的物体都显示在视窗中。每个单位应该有一个叫“bone_head”和一个叫“bone_chest”的骨骼,都将被放置在骨架的相应位置。这些将会被魔兽三的编辑器语言“Lock body-part facing”使用。另外,某些有角的建筑物也可以使用“bone_turret”来使它的角朝向某个目标。
Animation controller types
Position/Rotation/Scale controllers must be Bezier, Linear or TCB. Opacity and
visibility can be Bezier, Linear TCB or On/Off. The Parameter Curve Out-of-Range
types can be set to Constant (default) or Cycle (for global looping animation). IK
chains or character studio bipeds are not supported.
The Bezier controller can make a no-interpolation stepped sequence by using the
Bezier Key Info, In and Out Tangents, Step type. For more information, use 3ds max
help and search for “Bezier step tangent type”. This approach requires all the keys
in that controller track to be of the Tangents to Step type, but it can give instant
transforms quite unlike other animation controller blended transforms.
On/Off visibility controllers are treated as status toggle switch and can be inverted
by a parent’s On/Off controller. If a parent bone’s visibility track is animated
off and the child’s is animated off as well, the model can become corrupted in
Warcraft III, because its origin node has been removed from the animation, yet the
child becomes visible. This can cause strange effects, like children bones that
become attached to random objects.
动画控制器类型
位置,旋转和缩放的控制器必须为“bezier”,“linear”或者“TCB”类型。不透明度和可见度可以为“bezier”,“linear”,“TCB”或者“on/off”类型。“out-of-range”参数延伸曲线的类型可以为“constant(默认的)”或者“cycle(全局重复动画)”,IK骨骼链和Character studio的两组骨骼都不支持。
“bezier”控制器使用祯信息,进出切线和梯级类型来为动画序列生成非插值段数。需要更多相关信息请在3ds max的帮助文件里搜索“Bezier step tangent type”。这种方式需要其控制器轨迹里的每个祯都和其相应梯级成切线,但是它能生成比较快捷和流畅的变形,不像其他控制器那样混合了变形。
“On/Off”可见度控制器类似于开关切换,并且能被父物体的可见度控制器翻转。如果一个父级骨骼的可见度被关闭,而同时子级也被关闭,那么模型可能在魔兽三里面产生混乱,因为它的中心节点已经随同父物体从动画中被移除了,但是仍然被设为可见。这样就会导致奇怪的效果出现了。似乎子物体好像被附加在一个随机的东西上面。
Key frame requirements
Rotation controllers need to have a key every 90 degrees or less. If there are no
keys on the first and last frame of a sequence, the default position, frame 0, will
be used. On/Off visibility controllers are the only controller type that doesn’t
require a key frame on the first and last frame of a sequence.
关键祯要求
旋转动画的控制器需要至少每90度设置一个关键祯。如果在一个动画片断的起始和结尾没有设置祯,那么单位就会使用第0祯的默认位置。只有“On/Off”可见度控制器是个例外
Simple Unit Tutorial, step 5
基本模型教程,步骤五
It is time to make a three-bone skeleton made of geometry. Make 3 boxes named
Bone_Root, Bone_Head, and Bone_Jaw,respectively, and link them so Bone_Jaw is a child
of Bone_Head, which is a child of Bone_Root. Place them so the root bone’s origin is
at the origin in 3ds max, and the jaw and head are both roughly at the center of the
model (figure 12). Once you have the skeleton set up, make a key frame of position,
rotation and scale for all the bones at frame 0. For now, link the Simple Unit’s
sphere geometry to the Bone_Root. We will use the other two bones in a few more steps.
Figure 12
现在需要用物体构建一个包含三块骨骼的骨架系统。创建3个方盒体分别命名为“Bone_Root”,“Bone_Head”和“Bone_Jaw”,相应地,把“Bone_Jaw”链接为“Bone_Head”的子物体,把“Bone_Head”链接为“Bone_Root”的子物体。把他们放置在相应的位置并使根骨骼的中心位于场景中心,下巴骨骼和头部骨骼大致地放在模型的中间(参考图12)。当您布置好整个骨架,在第0祯为每个骨骼各自设置一个位移、旋转和缩放的关键祯。然后,把单位的球形模型链接到根骨骼上。
在随后的步骤里我们将使用另外两个骨骼。
Next we will animate the root bone for the walk cycle. Make the unit bounce with a few
key frames starting at frame 10 and ending on frame 40, same as the walk sequence we
made in Step 4. The quickest way we found to do this was by copying frame 0 to frame 10
and 40. On frame 25 with the Animate button on, we animated the root bone up along the
y axis about 100 units. If you preview your work now, there will be a few warning
errors, but you can see your animation To fix the errors, we will need to understand
the User Property Editor. Also let's look at skinning, called connected vertices in
Warcraft III, before we continue the tutorial.
现在我们将运动这个根骨骼以生成行走动作循环。像第4步一样的方法,在第10-40祯之间设置一些关键祯使单位产生弹跳动画。我们发现最快捷的途径是将祯0拷贝到祯10和祯40。在第25祯激活动画按钮,将根骨骼沿y轴向上移动大约100单位(英寸)。如果您现在预览模型,将会出现一系列错误提示,但是您可以观看动画并以之作参考来调整动画。在继续教程之前,我们必须很好地理解用户属性编辑器。同样,我们要看看如何蒙皮,在魔兽三里也就是称为连接模型点。
The User Property Editor
This rollout panel in the Utilities Toolbar is the interface for editing the user-
defined object properties. This menu changes to show available options depending what
is selected. If geometry is selected, the rollout will look like figure 13.
用户属性编辑器
这个位于Utilities工具栏里的卷展面板式用来为用户定义的单位设置属性的。根据选择物体的不同,该面板显示出的菜单也会有所区别。当选择几何体时,面板应该如图13所示。
User Property Editor options
2-D Model – This is for making and previewing art to be displayed in the 2D game space
like the UI cursor. When this is checked, the scale used by the game goes from 0 to 1
along the x and y axes (very small).
Anim Blend Time – This allows a preview of blend time from one animation to another.
This value is not used in the game.
Generic Object Properties
Billboarding – Causes a bone to rotate procedurally with relation to the camera as if
the front view in 3ds max was the camera direction. Full billboarding will cause the
object to always face the camera. The other options allow locking of axes.
Mesh Properties
Connected – This option is for models to skin across multiple pieces of geometry. See
Skinning the Model on the next page.
Sort Method – Alpha blend geosets can be made to sort by z distance against other
alpha blend geosets.
Connect Distance – This is the maximum distance that a pair of connected vertices can
be from each other and still be counted as connected. Zero is the default value, which
actually equates to .25 units. Entering a value other than zero will specify an exact
distance.
Priority Plane – Alpha-queued geosets can be made to draw in a specific order with
relation to each other in the same model. The lower the value is, the sooner it is
rendered. Values between -20 and 20 are regularly used.
Selection Group – Unused.
Object Types
Mesh – Default geometry.
Bone – Used to flag geometry so that it will not draw; instead, it will act as a
skeleton with full transforms.
Attachment Point – Attachment objects are geometry type bones that don’t draw but can
have art procedurally attached. See Setting up Attachment Points.
Collision Object – For flagging hit test geometry that is not drawn.
用户属性选项
二维模型:这个选项是用于制作平面模型的,比如游戏界面中的指针(光标)。当勾选这个选项时,模型尺寸必须是沿x轴和y轴上(只有两个维度)0到1的大小。
动画混和时间:该选项允许预览器预览从一个动画到另一个动画的混合过渡。这个值在游戏中不被使用。
类物体属性
布告板:就像3ds max中前视图是对着照相机一样,这个属性使骨骼能够程序地根据镜头旋转。完全布告板性质的物体会总是正面对着镜头。其他选项允许这种特性锁定某个轴向。
网格体(几何体)属性
连接的:当模型需要在多个几何体之间进行蒙皮时需要该选项。具体参见后面的模型蒙皮部分。
排序方式:透明度混合式的多边形组可以根据另一个多边形组依z轴向排序
连接距离:两个模型点在蒙皮时能被视为处于连接状态的最大距离。0是默认值。但实际上这个默认距离是大约相当于0.25个尺寸单位(也就是说不是理想状态的0距离)。输入一个值可以确定一个非0的距离。
优先权平面:在一个模型中,包含透明度序列的多边形组根据其关联以一定次序被绘制。这个值越低,这个平面所代表的多边形组将越优先被绘制。通常使用的值在-20到20之间。
选择组:这个选项通常不被使用
物体类型网格体(多边形体):正常的物体类型(在游戏中被显示出来的实体)
骨骼:用来标记实体的,因此不会在游戏中显示。同时,它作为一个骨架类型,含各种动画变形。
附着点:这种类型也类似于骨骼体,用来为游戏在模型单位身上附加一些特殊艺术的。具体参考后面的设置附着点部分。
碰撞物体:用来在游戏中为单位执行碰撞测试的类型
Skinning the Model
Connecting vertices is a straightforward way to set up equal bone weighting between
geometry pieces. Instead of having one geometry set influenced by many bones, the
Warcraft III Art Tools require that the individual pieces be chopped up into different
meshes in 3ds max. A leg can be made up of an upper leg and a lower leg. The vertices
around the knee on both the upper and lower leg meshes must line up at frame 0, and
both leg objects need to have the User Property – Connected flag checked. When they
animate in the 3ds max viewport, they will cause holes to appear, but when they are set
up correctly, the geometry will appear in the preview as welded together, causing the
knee vertices to get 50/50% between the two parent leg bones. Up to four bones can
influence one vertex.
为模型蒙皮
通过在不同的模型块之间建立点连接对于创建相应骨骼体式一个行之有效的办法。魔兽三art tool需要将每个模型按照动画需要分割成若干块,而不是(像3dsmax通用的角色动画方式那样)为整个物体设置庞大的骨架系统来制作动画。一条腿就被分为上下两个部分,而上下两部分靠近膝盖的那些点必须在第0祯就要对齐,两个部分都要在用户属性里标上“connected”(连接的)。当它们在3ds max的视窗中动画时,可能会有些上下交错之类的紊乱出现,那没关系,它们在预览器中将会显示很正常地连接在一起的,膝盖部的点会各有一半被融入上下两个部分了。最多可支持4块骨骼同时影响一个点。 |
|