A physical book

A physical book makes a digitized book “physical” by rendering it in a simulated space where properties like gravity, friction, and velocity all apply. The program randomly perturbs the letters, then takes a snapshot at a point in time, re-assembling the images into a new, “un-digitized” book. Prepared originally for National Novel Generation Month 2017.

Live demo with your custom text

Source code

Animation of the physics engine mutating the text

Sample pages

The raw, uncorrected scanned text of The Up-To-Date Sandwich Book: 400 Ways to Make a Sandwich (1909) is re-imagined as this 251 page (50,964 words) book:

Text that has been garbled

Text that has been jumbled up

Text that has been split

Implementation

A physical book uses the web-based game engine Phaser. Each page of the book is rendered into an invisible <div> (to produce correct leading and line-height), then copied into the Phaser game world with each letter instantiated as a distinct addressable sprite.

For each page, one of a dozen transformations is applied to give the text varying physical properties such as mass, acceleration, collision, or opacity.

On page load, the requested chapter number is rendered, the transformation is assigned, and the world is allowed to run. A Selenium wrapper script calls all 500 pages in succession, taking a screenshot at a random point in the animation. The final book is rendered in a two-page spread PDF.

Small 30 page sample.

Full 50,000+ word, 250 page PDF (55MB)

A Physical Book is mirrored on The Internet Archive, where the Up-To-Date Sandwich Book scans originated.