How do you draw like a Crayon?

Posted by Simucal on Stack Overflow See other posts from Stack Overflow or by Simucal
Published on 2009-02-03T22:50:47Z Indexed on 2010/05/20 0:20 UTC
Read the original article Hit count: 655

Filed under:
|
|

Crayon Physics Deluxe 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.

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.

While the game is basically a wrapper for the popular Box2D Physics Engine, it does have one feature that I'm curious about how it is implemented.

Its drawing looks very 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.

alt text alt text

The background texture is freely available here.

alt text
Close up of crayon drawing - Note the varying darkness

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?

© Stack Overflow or respective owner

Related posts about graphics

Related posts about crayon