Path: utzoo!attcan!uunet!husc6!purdue!decwrl!granite!allen From: allen@granite.dec.com (Allen Akin) Newsgroups: comp.graphics Subject: Re: How do I handle this kind of model?? Message-ID: <229@granite.dec.com> Date: 21 May 88 01:04:08 GMT References: <1131@ndmath.UUCP> Reply-To: allen@decwrl.dec.com (Allen Akin) Organization: DEC Technology Development, Palo Alto, CA Lines: 44 Keywords: In article <1131@ndmath.UUCP> milo@ndmath.UUCP (Greg Corson) writes: > >I need to model various types of smooth surfaces such as rolling >hills, car bodies, human faces etc... > ... The odd part is that the rendering routine will need >to look for sudden changes in the objects contours (or places >where one object overlaps itself or another of the same color) >and draw "feature lines" at those places. For example, if you >were modeling a piece of metal with a very gentle bend, only the >outer edges would be drawn in as black feature lines....however >if you had a piece of metal with a sharp 45 degree bend in it >there would be a black like at the location of the bend. (I've replied to Greg directly, but I'm posting this to see if anyone has a better solution.) I had a similar problem once. Maybe the technique I used will be of help. I rendered the scene, buffering up a scanline at a time. For each pixel I recorded both the intensity (with or without shading, as you prefer) and the surface normal. In a postpass I then computed the angles between adjacent normals (in both the X and Y directions) and changed the pixel color if the normals diverged by more than a threshold. I also changed the pixel color if the distance from the eye to the surface changed more than a threshold, even if the normals were roughly the same. The results were fairly pleasing, and didn't require much threshold tuning. Sharp object edges are displayed correctly, and false edges (such as those generated by interpenetrating objects) are handled automatically. I used a ray tracer because I had analytically-defined objects and extremely tight constraints on memory. (In fact, I had so little memory available that I couldn't tessellate the objects I was rendering.) You can use a similar approach with a scanline rendering algorithm, or with Z buffering if you also have a place to store the normals for the postpass. If you use a ray tracer, be careful about your numerical methods; if the intersection points aren't fairly accurate, you get jagged edges. Allen