ISR Report 05 .fr

feeding a small number of position data to the system. We will ... 2.2 Body modeling . ... simulate muscles. ... range of motion or to control an attribute based on the movement of another. ... Surfaces play an important role in the overall Maya workflow as they .... Smooth skinning and rigid skinning are direct skinning methods.
322KB taille 5 téléchargements 329 vues
Human Machine Interfaces Animation

LAAS/ISR Report 05 Character animation using Maya software Date: 17th August 2005

Enguerran Boissier LAAS, Universite Paul Sabatier, 118, route de Narbonne, 31062 TOULOUSE FRANCE http://www.iup-ups.ups-tlse.fr/si

Project sponsored by ISR University of Coimbra - Polo II Pinhal de Marrocos, 3030-290 Coimbra PORTUGAL http://www.isr.uc.pt

Abstract: This report present the modeling and the animation of a 3D character using data from our human tracking interface. It shows that it is possible to fully animate a 3D character by only feeding a small number of position data to the system. We will use for this task our human tracking interface which produces 2D position data of the hands and the face. The position data is taken from a human motion sequence. The 3D modeling and animation is done by the 3D software Maya. Taking advantage of the IK handle functionality to animate a whole kinematic chain of limbs. For the projection model from the 2D image to the 3D Maya world, we only use a rough estimation. Key words: modeling, animation, maya

CONTENTS

2

Contents 1 Introduction

3

2 Character setup 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Body modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Skeleton modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 3 4 4

3 Character animation 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Animation from data files . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6 6 7

4 Implementation

8

5 Results and discussions

8

6 Conclusion

9

3

1

Introduction

This report present the modeling and the animation of a 3D character using data from our human tracking interface. It shows that it is possible to fully animate a 3D character by only feeding a small number of position data to the system. We will use for this task our human tracking interface which produces 2D position data of the hands and the face. The position data is taken from a human motion sequence. The 3D modeling and animation is done by the 3D software Maya. Taking advantage of the IK handle functionality to animate a whole kinematic chain of limbs. For the projection model from the 2D image to the 3D Maya world, we only use a rough estimation. Maya is a software application for 3D digital animation and visual effects. Maya provides a comprehensive suite of tools for 3D content creation work ranging from modeling, animation, and dynamics through to painting and rendering to name but a few. With Maya, you can create and edit 3D models in a variety of modeling formats and animate your models using Maya’s suite of animation tools. You can create convincing visual simulations of rigid and soft body objects interacting in the physical world using the computational dynamics and particles tools. Maya also provides a range of tools to allow you to render your animated 3D scenes to achieve photo realistic imagery and animated visual effects.

2

Character setup

2.1

Introduction

A typical 3D character can be made up of many surfaces and components [1]. To ensure that the character animates in the way that you want, it is important to carefully plan the process of character setup. Character setup or rigging is the general term used for the preparation of 3D models with their accompanying joints and skeletons for animation. Depending on the model to be animated, character setup can involve the following techniques: • Creating a 3D character model by modeling surfaces • Creating a skeleton with joints that acts as a framework for the 3D character model. You set limits on the joints so they rotate in a convincing manner. When you animate the character, you will be posing the character via its joints using either forward or inverse kinematic techniques (FK or IK). • Binding the 3D surfaces to the skeleton so that they move together. The process of binding may also include defining how the character’s joints bend or how the skin surfaces bulge to simulate muscles. • Defining and setting constraints for particular animatable attributes in order to restrict the range of motion or to control an attribute based on the movement of another.

2.2 Body modeling

2.2

4

Body modeling

In Maya, modeling refers to the process of creating virtual 3D surfaces for the characters and objects in the Maya scene. Surfaces play an important role in the overall Maya workflow as they are the items upon which shading and texture attributes will be assigned. It is these attributes that assist in the creation of a convincing 3D image. The more accurate you are when modeling your forms in terms of size, shape, detail, and proportion, the more convincing your final scene will become. There are three modeling surface types in Maya: • Polygons • NURBS • Subdivision surfaces Polygon surfaces are a surface type comprised of flat surfaces called faces. You can create a single polygonal face or a network of polygonal faces called a poly mesh. A poly mesh is comprised of many faceted three-or-more flat sided polygon faces. When a poly mesh is rendered, it is shaded smoothly so that the facets are not as apparent in the final image. NURBS (Non-Uniform Rational B-splines) use a method of mathematically describing curves and surfaces that are well suited to 3D applications. NURBS are characterized by the smooth organic forms they produce. Subdivision surfaces are a hybrid surface type that possess characteristics of both NURBS and polygonal surfaces as well as other features not offered by the other surface types. Like NURBS, subdivision surfaces are capable of producing smooth organic forms and can be shaped using relatively few control vertices. Like polygonal surfaces, subdivision surfaces let you extrude specific areas and create additional detail in your surfaces. You do this by working at different levels of detail on the subdivision surface and switching between the levels when necessary. With a subdivision surface you can build a smooth organic object from a single primitive and not be concerned about attaching or stitching the various surfaces together as you would for a NURBS surface [1]. Using these surfaces and modeling them, you can now create the different part of your body. Usually we create the character body in a T (or Da Vinci) position(see figure 1). Once each part of your body created, you should group (or attach) them in only one object. You will be able in case of need to ungroup them. Grouping makes it easier for you to apply an action to multiple objects and will allow you to bind it with your skeleton(see below).

2.3

Skeleton modeling

The next step in character setup is to create a skeleton so you can control a character’s actions [2]. Building skeletons is the process of constructing hierarchical, articulated structures made of joints and bones. A skeleton provides a structure for animating the character. When you create a

2.3 Skeleton modeling

5

Figure 1: rendered or not body in T position

Figure 2: skeleton created from five joint chains

skeleton in Maya, you create a series of bones with joints in the skeletal locations where you want the character to bend or twist (You can animate a skeleton without having a skinned character). As you construct a skeleton, use multiple camera views to make sure that your skeleton fits the deformable objects appropriately in all three dimensions. So far you have created five separate joint chains: one for the spine, and one for each arm and each leg. You need to create a single hierarchy from the five joint chains so you can move all of them as a single unit. To create the single hierarchy, you parent the arms and legs to the nearest joint in the spine (see figure 2). When you bind a character to a skeleton (described below), the skeleton provides a structure for the character’s skin and prevents the skin from collapsing as you pose the skeleton. It’s useful to add extra joints in areas of the character where you want the surface to keep its volume upon deformation. By posing a skeleton with IK (Inversed Kinematics), you create an extra control structure, an IK handle, for certain joint chains such as arms and legs [2]. An IK handle lets you pose and animate an entire joint chain by moving a single manipulator (see figure 3). An IK handle is like a wire that can run through a joint chain, providing a way for you to pose the entire joint chain in one

6

Figure 3: skeleton with IK handles

Figure 4: skeleton and body bound

action. As you pose and animate the joint chain with the IK handle, the IK handle automatically figures out how to rotate all the joints in the joint chain by using its IK solver. The IK solver is the motor intelligence behind the IK handle. For example, if you want a joint chain to reach a particular location in space, you can move the entire chain by using the IK handle that runs through the chain. Given where you want the joint chain to reach, the IK solver figures out how to rotate all the joints in the joint chain for you by means of Maya’s inverse kinematics methods. You can make your skeleton behavior more realistic by putting some constraint on joints angle values. After having create a skeleton, you should bind it with the character’s surface so that the surfaces move with the skeleton during animation. Binding is also called skinning, and a character’s surface after binding is called a skin (see figure 4). Skinning is the process of setting up a character’s model so that it can be deformed by a skeleton. You skin a model by binding a skeleton to the model. You can bind a model to a skeleton by a variety of skinning methods, including smooth skinning and rigid skinning. Smooth skinning and rigid skinning are direct skinning methods. You can also use indirect skinning methods, which combine the use of lattice or wrap deformers with either smooth or rigid skinning.

3 3.1

Character animation Introduction

Maya allows you to bring action to the objects in your 3D scene. In Maya, when an object or attribute changes in relation to time, it is referred to as being animated. To animate an object on Maya, you should assign to it some keyframes. When you set a keyframe (or key), you assign a value to an object’s attribute (for example, translate, rotate, scale, color, etc.) at a specific time. Most animation systems use the frame as the basic unit of measurement because each

3.2 Animation from data files

7

frame is played back in rapid succession to provide the illusion of motion. When you set several keys at different times with different values, Maya generates the attribute values between those times as the scene plays back each frame. The result is the movement or change over time of those objects and attributes.

3.2

Animation from data files

Maya is an open product. This means that can change Maya’s existing features or add entirely new features. There are two ways you can modify Maya: • MEL—(Maya Embedded Language) is a powerful and easy to learn scripting language. Most common operations can be done using MEL.

• API—(Application Programmer Interface) provides better performance than MEL. You can add new objects to Maya using the API, and code executes approximately ten times faster than when you perform the same task using MEL. Also, you are able to execute MEL commands from the API. MEL is a scripting language at the heart of Maya. Maya’s user interface is created using MEL, and MEL provides an easy way to extend the functionality of Maya. Everything you can do using Maya’s graphical interface can be automated and extended using MEL.Familiarity with MEL can deepen your understanding of and expertise with Maya. The Maya API is a C++ API that provides internal access to Maya. You can use the API to implement two types of code resources: plug-ins which extend the functionality of Maya, or stand-alones such as console applications which can access and manipulate a Maya model. A way to control a Maya’s object or character outside of Maya is to use scripts. Indeed scripts can allow us to read into files the values we want to assign to parts of our object. We just need to know which elements of the object we want to control. Let’s just assume the file must be laid out in the following format: frameNumber Xtranslation Ytranslation Ztranslation 7

2

4

6

10

3.7

3.6

9.3

20

7.4

5.7

3.9

24

4.2

32 16.2

6.789 2.457 3.45

9.75

Thus we can create for each line (or each frame) a keyframe, setting the values x,y,z of the object we want to control with the values of the line. We use the function setKeyframe for this task (for all the function, or some tutorials about Maya, see the help file provided on Maya software [1] [3] [2]).

8

Figure 5: Position of the skeleton in the beginning

4

Implementation

We get the position of the head and the hands of a person within an image from our human tracking interface [?]. To this point we first write the position data into a file and read the data afterwards using maya MEL script. Due to projection, we need to convert the position within the image to a position for the body within maya world. At first we define a value scale which allows to convert a distance within the image to a distance within maya world. For our task, scale=2.114/25. 25 is the distance between X hands position and the X value of the center of the face (assumed as the X value of the center of the body) within the image and 2.114 is the value representing the same distance but in the maya world. We then assume that in the beginning, hands are down along the body. Thus we can calculate the first supposed position for hands and the face, independently of the position of the body within maya. For each further position, we will calculate the distance we moved within the image and apply this distance within maya. In the beginning, hands Y position should be equal to the Y of the origin of the maya body or root joint (down of the spine), i.e hands are at the same height than the root joint. Hands X position are the same than body X position plus or minus the difference between hands and head within the image multiplied by scale. Head X position is set as body X position(see figure 5).

5

Results and discussions

This sequence (6) shows that it is possible to control a movement of a 3D object by data taken from a file. The data was created by our human tracking interface observing a person performing some hands and face movements. Figure shows that the motions are similar even though we only use a rough estimation for the perspective projection.

9

Figure 6: Sequence of animation from 2D positions taken within an image

6

Conclusion

This report has shown the modeling and the animation of a body bound to a skeleton with maya software. We are able to add some constraint to give him some human behavior. We also achieve to animate the body from files containing values associated to a frame number by setting some key-frames.

REFERENCES

References [1] Alias(http://www.alias.com). Maya Help. [2] Maya ebooks. Character Setup. [3] Maya ebooks. Character Animation.

10