Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you draw like a Crayon?
    text
    copied!<p><a href="http://www.crayonphysics.com/" rel="noreferrer">Crayon Physics Deluxe</a> is a commercial game that came out recently. Watch the video on the main link to get an idea of what I'm talking about.</p> <p>It allows you to draw shapes and have them react with proper physics. The goal is to move a ball to a star across the screen using contraptions and shapes you build.</p> <p>While the game is basically a wrapper for the popular <a href="http://www.box2d.org/" rel="noreferrer">Box2D Physics Engine</a>, it does have one feature that I'm curious about how it is implemented.</p> <p>Its drawing looks <em>very</em> much like a Crayon. You can see the texture of the crayon and as it draws it varies in thickness and darkness just like an actual crayon drawing would look like.</p> <p><a href="http://www.kloonigames.com/crayon/screenshots/crayon_small_01.jpg" rel="noreferrer">alt text http://www.kloonigames.com/crayon/screenshots/crayon_small_01.jpg</a> <a href="http://www.kloonigames.com/crayon/screenshots/crayon_small_02.jpg" rel="noreferrer">alt text http://www.kloonigames.com/crayon/screenshots/crayon_small_02.jpg</a></p> <p>The background texture is freely available <a href="http://flickr.com/photos/felipeskroski/325477721/" rel="noreferrer">here</a>.</p> <p><a href="http://img267.imageshack.us/img267/1488/crayonmh7.png" rel="noreferrer">alt text http://img267.imageshack.us/img267/1488/crayonmh7.png</a><br> <em>Close up of crayon drawing - Note the varying darkness</em></p> <p>What kind of algorithm would be used to render those lines in a way that looks like a Crayon? Is it a simple texture applied with a random thickness and darkness or is there something more going on?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload