Our Properties: Gamasutra GameCareerGuide IndieGames Indie Royale GDC IGF Game Developer Magazine GAO
My Message close
Contents
2D Surface Deformation
 
 
Printer-Friendly VersionPrinter-Friendly Version
 
Latest News
spacer View All spacer
 
February 9, 2012
 
What Nintendo's 2011 sales mean for Wii U, third parties [1]
 
DICE 2012: Culture, pride lead to success at Skyrim maker Bethesda [3]
 
DICE 2012: Is the publishing model broken? [15]
spacer
Latest Jobs
spacer View All     Post a Job     RSS spacer
 
February 9, 2012
 
Sony Computer Entertainment America LLC
Senior On-line Programmer
 
Radical Entertainment / Activision
AI Programmer (Senior)
 
Visual Concepts
Senior Producer, VC China (Shanghai)
 
Visual Concepts
Software Engineer, VC China (Shanghai)
 
2K Marin
FX Artist - XCOM
 
Visceral Games Redwood Shores
Sr. Gameplay Engineer-Visceral Games
spacer
Latest Features
spacer View All spacer
 
February 9, 2012
 
arrow Postmortem: CyberConnect 2's Solatorobo: Red the Hunter
 
arrow Jerked Around by the Magic Circle - Clearing the Air Ten Years Later [32]
 
arrow Building the World of Reckoning [4]
 
arrow SPONSORED FEATURE: TwitchTV - How to Build Community Around Your Game in 2012 [13]
 
arrow Happy Action, Happy Developer: Tim Schafer on Reimagining Double Fine [9]
 
arrow Building an iOS Hit: Phase 1 [11]
 
arrow Postmortem: Appy Entertainment's SpellCraft School of Magic [5]
 
arrow Talking Copycats with Zynga's Design Chief [82]
spacer
Latest Blogs
spacer View All     Post     RSS spacer
 
February 9, 2012
 
Did DoubleFine Just break the publishing model for good?
 
The Devil Is in the Details of Action RPGs - Part One: The Logistics of Loot [2]
 
Xbox LIVE Indie Games at it Again
 
Merging Waterfall and SCRUM [3]
 
Business Post Mortem: Wolf Toss: Pre-launch Planning & Blended CAC
spacer
About
spacer Editor-In-Chief/News Director:
Kris Graft
Features Director:
Christian Nutt
Senior Contributing Editor:
Brandon Sheffield
News Editors:
Frank Cifaldi, Tom Curtis, Mike Rose, Eric Caoili, Kris Graft
Editors-At-Large:
Leigh Alexander, Chris Morris
Advertising:
Jennifer Sulik
Recruitment:
Gina Gross
 
Feature Submissions
 
Comment Guidelines
Sponsor
Features
  2D Surface Deformation
by Max Fomitchev [Programming, Visual Art]
Post A Comment Share on Twitter Share on Facebook RSS
 
 
February 16, 2000 Article Start Page 1 of 4 Next
 

The rapid growth of CPU power opens possibilities for development of 3D games that feature realistic environment. The increase in the performance of graphics accelerators frees additional CPU cycles that can be used for real-time physical world modeling.

Game realism can be improved by simulating deformable objects or deformable surfaces. The list of common deformable objects and surfaces include:


  • water (waves, streams, waterfalls), wind and splashes simulation;
  • cloth (capes, flags, curtains), wind and wrinkle simulation;
  • soil (mud, clay), imprint and crater simulation;
  • vegetation (grass, trees), wind simulation.

Simulation of deformable objects results in unique experience of realistic never-the-same environment. Wind that causes waves and makes grass bend; objects that produce ripples when dropped in water; soil covered with footprints and explosion craters.

The user receives much richer sense of reality when the geometry of an object is modified rather than when anew or animated texture is mapped on to it because correctly deformed objects will look right from any angle and in any lighting conditions. Also deformed objects can block or reveal other objects behind them.

The implementation of deformable surfaces discussed in this article is intended for real-time 3D games that simulate realistic environment. The algorithm is optimized for AMD 3DNow! technology. Different implementations and their performance are discussed.

Physics of 2D surface deformation

Consider a grid that represents a simple 2D surface as shown on figure 1. Each vertex on the surface is connected with 6 neighbors to the north, east, southeast, south, west and northwest. This interconnection defines local topology. The neighboring vertices interact with each other by means of elastic forces (i.e. interconnections between vertices, depicted as solid lines on the figures, act as coil springs). In the initial (relaxed) state vertices are evenly spaced, and vectors SRelaxE, SRelaxSE, SRelaxS specify distances between neighbors. In the relaxed state elastic forces between vertices are equal to zero.

Figure 1. 2D deformable surface at time t0=Dt, t1=2Dt and t2=3Dt.

When an external force (Fext) is applied to a vertex on the surface at time t0=Dt, the vertex starts moving and displaces to a new location time t1=2Dt. This displacement produces elastic forces between local topological neighbors. The resulted elastic forces counter the displaced vertex motion and try to return the vertex to its original location. However according to the 3rd Newton’s law the same forces but with opposite direction act upon neighboring vertices. So at time t2=3Dt the neighbors get displaced, and entire cluster of vertices comes in motion. With time more and more vertices get involved in motion, representing wave propagation across the surface.

The 2D surface is characterized by the following parameters:

  • local topology;
  • global topology (i.e. plane, cylinder, sphere, etc.)
  • vertex mass m;
  • relaxation distances (SRelaxE, SRelaxSE, SRelaxS);
  • elasticity model (linear, exponential, etc.);
  • elasticity constant (elasticity tensor E for anisotropic surfaces) E, E >= 0;
  • damping constant (damping tensor D for anisotropic surfaces) d, 0 <= d <= 1.

Greater elasticity corresponds to faster deformation and stiffer body, while low elasticity corresponds to softer bodies.

Smaller damping represents faster relaxation or faster solidification for ductile surfaces.

This paper deals with plane isotropic surfaces combined from identical particles with mass m with six-neighbor local topology and linear elasticity model.

Figure 2. Vertex forces.

State of a vertex on the surface is characterized by coordinate vector S, velocity V, total internal (elastic) force FTotal and external force FExt.

The surface deformation is calculated for each vertex in the following way. First vertex displacement relative to the east, south and southeast neighbors is calculated:

DSE = SE - S - SRelaxE

DSS = SS - S - SRelaxS

DSSE = SSE - S - SRelaxSE

Then elastic forces between local neighbors are evaluated:

FE = Elasticity · DSE

FS = Elasticity · DSS

FSE = Elasticity · DSSE

Total force acting on the vertex under consideration is:

FTotal = FE + FS + FSE

According to the 3rd Newton’s Law the vertex under consideration contributes to the total force acting on its neighbors:

FTotalE = FTotalE - FE

FTotalS = FTotalS - FS

FTotalSE = FTotalSE - FSE

Notice that north, west and northwest elastic forces are not calculated directly. The total force for the vertex FTotal is updated automatically when north, west and northwest vertices are processed (3rd Newton’s law).

Finally, when all vertices on the surface are processed (i.e. all internal forces evaluated) new coordinates are calculated for each vertex.

Acceleration is calculated from the 2nd Newton’s law:

a = (FTotal + Fext)/m

The rest is discrete numerical integration:

DV = a · Dt

V = V + DV

DS = V · Dt

S = S + DS

Lastly vertice velocity is adjusted in order to account for damping:

V = V · d

 
Article Start Page 1 of 4 Next
 
Comments


none
 
Comment:
 




UBM Techweb
Game Network
Game Developers Conference | GDC Europe | GDC Online | GDC China | Gamasutra | Game Developer Magazine | Game Advertising Online
Game Career Guide | Independent Games Festival | Indie Royale | IndieGames

Other UBM TechWeb Networks
Business Technology | Business Technology Events | Telecommunications & Communications Providers

Privacy Policy | Terms of Service | Contact Us | Copyright © UBM TechWeb, All Rights Reserved.