40
SH1 SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING Dynamics in Maya Gary Monheit Alias | Wavefront

Dynamics in Maya

Embed Size (px)

Citation preview

Page 1: Dynamics in Maya

SH1SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Dynamics in Maya

Gary MonheitAlias | Wavefront

Page 2: Dynamics in Maya

SH2SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Dynamics in Maya

• Overall Requirements

• Architecture and Features

• Animations

Page 3: Dynamics in Maya

SH3SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Overall Requirements

• Why Dynamics?

• Problems with traditional animation techniques

• Kinds of dynamics problems

• Requirements for software architecture

Page 4: Dynamics in Maya

SH4SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Why Dynamics?

Page 5: Dynamics in Maya

SH5SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Problems with traditional animatio n

• Hard to keyframe

• Rendered polygons don’t give desired effects

• Amorphous effects hard to achieve

• Lacks high−level control, simulation

• Lacks procedural control

Page 6: Dynamics in Maya

SH6SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Kinds of dynamics problems

Particles

• Contain a set of points in global space with attributes• Affected by dynamic solver• Created at either object creation time or by emitters• Handle birth and death• Support a variety of rendering techniques

Soft Bodies

• Geometry with points updated by a particle object• Superset of all particle features

Rigid Bodies

• Geometry with fixed topology and points• Affected by collisions, constraints, and external forces

Page 7: Dynamics in Maya

SH7SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Requirements for software architecture

• Integrated

• Extensible

• Reusable

• Tweakable

• Support Relationships

Page 8: Dynamics in Maya

SH8SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Integrate d

Maya as scene object architecture • Nodes • Attributes • Connections

Keyframing • Any scalar attributes • 3D motion of non−dynamic objects • Keyframe editors are familiar to animators

Layered procedural animation • Output from dynamics can be input to other nodes • Outputs from other nodes can be input to dynamics

Rendering • Rendered within Maya or exported to other renderer • Software rendering (volumetric) • Hardware rendering (openGL)

Page 9: Dynamics in Maya

SH9SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Extensible

• Maya embedded language (Mel)

• Parameter driven: attributes

• ASCII scene file format

Page 10: Dynamics in Maya

SH10SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Reusable

• Layered scenes with geometry and effects

• Create your own clipFX with Mel

Page 11: Dynamics in Maya

SH11SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Tweakable

Attributes are modifiable

• Keyframes • Expressions • Connect to other nodes • Add user−defined attributes

Page 12: Dynamics in Maya

SH12SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Relationships

• Object−to−object relationships

• Attribute−to−attribute relationships

Page 13: Dynamics in Maya

SH13SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Dynamics in Maya

• Overall Requirements

• Architecture and Features

• Animations

Page 14: Dynamics in Maya

SH14SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Architecture & Features

• Maya Architecture

• Dynamic Architecture

• Rendering

• Expressions

• Integrated Dynamics

Page 15: Dynamics in Maya

SH15SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Maya Architecture (part 1)

• Nodes

• Attributes

• Connections

Page 16: Dynamics in Maya

SH16SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Maya Architecture (part 2)

• Transforms and Shapes

• DAG: Directed Acyclic Graph

• The "object" is really the transformplus the shape(s)

Page 17: Dynamics in Maya

SH17SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Dynamics Architecture

• Particles

• Fields• Emitters• Collision Models• Particle Collision Events

• Controllers

• Connectables and Connections

• Soft Bodies• Springs

• Rigid Bodies

Page 18: Dynamics in Maya

SH18SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Particles

• A particle object is a particle system

• Per−particle (array) attributes vs.scalar attributes

• User−defined attributes

• Particles act independently

• No particle−to−particle collisions

• What affects particles?• Fields• Springs• Attribute values• Expressions (one−line or multi−line)• Dynamics controller attributes

Page 19: Dynamics in Maya

SH19SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Fields

• Positional fields

• Geometry fields. Example: sphere owns radial field

• Types of fields • Air • Drag • Gravity • Newton • Radial • Turbulence • Uniform • Vortex

Page 20: Dynamics in Maya

SH20SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Emitters

Emitters • Creates new particles into a particle object • Hose vs. water. Emitter is the hose.

Positional emitter • The transform defines the position, orientation • Parented, keyframed, in IK chain, ...

Geometry emitter • Geometry owns the emitter • Point vs. surface • Particle, NURBS, polygon, lattice, curve ...

Page 21: Dynamics in Maya

SH21SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Collision Models

• Elasticity

• Friction

• Collision trace depth

Page 22: Dynamics in Maya

SH22SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Particle Collision Events

• In the event that a particle collides: • Emit • Split • Die

• Optionally call a Mel proc each time the event occurs

Page 23: Dynamics in Maya

SH23SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Connectables and Connections

Dynamics objects: • Particles • Soft bodies • Rigid bodies Connectable object owns one or more of any combination of: • Fields • Emitters • Collision models

What kind of object can be a connectable: • Polygon, NURBS, lattice, curve, ...

Dynamics object Connectable objectconnect flags

Page 24: Dynamics in Maya

SH24SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Examples of connections

Description Conn Type Connection

Sphere emits particles emission particles −> sphere

Particles fall under field particles −> gravity gravity

Particles bounce on collision particles −> surface surface

Particles owning radial field soft cube −> particles field repel a soft cube

Point emitter emits emission soft mesh −> pt emitter soft mesh

Page 25: Dynamics in Maya

SH25SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Controllers

• Manage dynamic objects that may interact

• Interface to a differential equations solver

• Necessary so that all dynamics objects get updated in sync

• Hold global attributes for dynamics

Page 26: Dynamics in Maya

SH26SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Goals

• Goals are geometry, particles, or soft bodies referenced in a particle object

• Create a force for each particle to move toward a pointon the goal

• Particles or soft bodies can have multiple goals

• Does not require the same number of points as target

• Individual goal weight 0 to 1

• Attribute goalPP 0 to 1 (per−particle)

• Dynamics weight 0 to 1 for the forces generated by fields and collisions

Page 27: Dynamics in Maya

SH27SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Springs

• Classical mechanics spring

• Hook’s Law

• Stiffness and damping

• Start force weight, end force weight

• 0 to 1• Amount of the force of the spring that gets applied

to either start or end point• (0, 1) or (1, 0) simulates nailing one end of the spring

Page 28: Dynamics in Maya

SH28SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Soft bodies

• Soft is a command, not a node

• For the user, soft bodies are geometry whose points are updated by a particle object

• Internally, soft bodies are the particle object

• Geometry converted or duplicated in a soft body

• Springs generated by min−max distance or by walk length

• Oversampling (small solver step size) stabilize springs

Page 29: Dynamics in Maya

SH29SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Rigid Bodies

• Nodes

• Rigid body

• Constraints • Nail • Pin • Hinge • Spring • Barrier

• Transformations updated by a solver that applies forces

• Internal constraints added implicitly (by contact) or explicitly (by constraint objects)

Page 30: Dynamics in Maya

SH30SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Rigid Body Features

• Contact forces handled for resting and sliding objects

• Static and dynamic friction

• Active rigid body• collision detection• dynamic response

• Passive rigid body• collision detection• independent control by keyframes, expressions,

other nodes

• Cache motion

• Collision layers used to reduce complexity

• Choice of 3 kinds of solvers

Page 31: Dynamics in Maya

SH31SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Renderin g

• Render Types

• Hardware Rendering in OpenGL

• Software Rendering

Page 32: Dynamics in Maya

SH32SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Render Types

• Point• Multi−point

• Streak (lines)• Multi−streak

• Sprites (textures)

• Sphere• Geometry

• Numeric (for debugging)

• Tube (Software)• Cloud (Software)• Blobby Surface (Software)

Page 33: Dynamics in Maya

SH33SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Software renderin g

• Volumetric rendering

• Blobby surface render type uses any shader

• Tube and Cloud render types use specificparticle cloud shader

• Future: hair shader

Page 34: Dynamics in Maya

SH34SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Expressions

• Mel Language

• Attribute Expressions

• Particle Expressions

Page 35: Dynamics in Maya

SH35SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Mel Language

• Maya Embedded L anguage

• Unified language for file format, commandengine, and expressions

• Like C

• Like shell

Page 36: Dynamics in Maya

SH36SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Attribute Expressions

• Lazy evaluation − evaluate when needed

• Multi−line expressions

• Multiple input and output attributes

Page 37: Dynamics in Maya

SH37SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Particle Expressions

• Particle expressions executed per−particle• Multi−line expressions are like small programs• Any attribute accessible for setting and getting values• Run−time vs. creation rules• Built−in functions for math, system, I/O, arrays• Data types: int, float, string, vector

int[], float[], string[], vector[]• Maya commands can be called from expressions

Example:

// Creation rule for setting color: dynExpression −c −at rgbPP −s "rgbPP = sphrand(1);" colorCloud;

// Runtime rule for setting color: dynExpression −r −at rgbPP −s "if( age > .5 ) rgbPP += <<0,0,rand(.1)>>;" colorCloud;

Page 38: Dynamics in Maya

SH38SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Integrated Dynamics

• Dynamics and transforms

• Rigid Bodies − active and passive

• Soft Body, curves, and IK chain

• Soft Body and deformers

• Soft Body, Rigid Body, and goals

• Particle collision events ...

Page 39: Dynamics in Maya

SH39SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Dynamics in Maya

• Overall Requirements

• Architecture and Features

• Animations

Page 40: Dynamics in Maya

SH40SIGGRAPH ’97 COURSE NOTES PHYSICALLY BASED MODELING

Future Work

• Maya 2.0