Get the latest tech news

Verlet Integration and Cloth Physics Simulation (2022)


Physics simulation in games is a super vast and interesting topic! This article explores how Verlet integration can be used to simulate 2D cloth physics with JavaScript and C++.

But even more fun than watching objects bounce around the screen is to understand how we can use simple concepts from high-school mathematics to simulate those physics laws with code. If you remember all this stuff from university or even from the 2D Game Physics Programming course here at pikuma.com, then I think you can skip the following section and continue from the part titled"Numerical Integration of Equations of Motion". I'll also show you how mouse inputs are handled to drag and tear the cloth, and thus you'll also learn a bit about SDL(Simple DirectMedia Layer) if you've never worked with this library before.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of integration

integration

Photo of simulation

simulation

Photo of verlet

verlet

Related news:

News photo

Physicists Say Light Can Be Made From Nothing and Now They Have the Simulation to Prove It

News photo

From the Creators of Shortcuts, Sky Extends AI Integration and Automation to Your Entire Mac

News photo

A Simulation in C++ of Joseph Weizenbaum's 1966 Eliza