flipCode - Tech File - Anis Ahmad [an error occurred while processing this directive]
Anis Ahmad
Click the name for some bio info

E-Mail: mighty_ernie@hotmail.com

   07/24/1999, Cartoon Rendering

Here's a short by simple blurb on how to render meshes as if they're cartoons (y'know with the penciled in borders). I came up with this idea while investigating the concept. There are other ways of doing it, and I *know* I'm not the first to come up with this one.

It's a pretty simple procedure which assumes that, at most, only two polygons attached share a given edge). You will need to store a list of edges, and each edge will need an index specifying it's neighbouring triangles.

Basically, you do the following two checks, if either of these checks pass, you flag the edge as a pencil edge.

1. For an edge, if only one face attached to the edge is visible, flag it. ie. If one is backfaced and the other isn't, or if only one face is attached (making it a boundary edge).

2. If the angle between the attached faces is within a certain threshold. ie. < 30 degree, or > 150 degrees

So a potential rendering process for one of these meshes would be

1. Transform the mesh.
2. Draw the faces.
3. Perform the checks.
4. Draw the pencil-flagged lines over top of the faces. You'll need PolygonOffset if you're using OpenGL, or ZBIAS if you're using DirectX (assuming you've got it supported).

That's all I had to say, you can pass along comments to the mailing list if you're on it.

-- Anis Ahmad

  • 07/24/1999 - Cartoon Rendering
  • 04/30/1999 - Hybrid Visibility (HyVis)

  • This document may not be reproduced in any way without explicit permission from the author and flipCode. All Rights Reserved. Best viewed at a high resolution. The views expressed in this document are the views of the author and NOT neccesarily of anyone else associated with flipCode.

    [an error occurred while processing this directive]