• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Drawing the outline of an object.

## 2 posts in this topic

today isnt a good day. 2 requests for help at once . anyway. does anyone know how to draw the outline of an object? i dont mean the wireframe, i mean the outline. also, i need the rest of the object to be transparent. for example: imagine a quad (q) and a sphere (s). the sphere is larger and infront of the quad. if you rendered it, it might look like this:
     ssss
qqssssssssqq
ssssssssssss
ssssssssssssss
ssssssssssssss
ssssssssssss
qqssssssssqq
ssss

notice how you can only see the corners of the quad? right, now the effect i want to pull off is this:
     ssss
qq**qqqq**qq
*          *
sq          qs
sq          qs
*          *
qq**qqqqq**q
ssss

the * is where both objects overlap. in the end, it should look like this:
     ****
************
*          *
**          **
**          **
*          *
************
****

damn these drawings are poor . notice how the sections of the sphere arnt rendered, just its outline. this is what i want to pull off. i was thinking of using the stencil buffer for this, i.e. draw the object into the stencil buffer, then set rendering to line only mode, and dont let it draw where the object has been stencilled in (give it a good line width so that the lines will overlap the borders), but 1) the stencil buffer refuses to work (yet other demos i've downloaded work fine) and 2) it seems a slow way of doing it. any and all help appriciated. MENTAL Edited by - MENTAL on October 10, 2001 7:06:15 AM
0

##### Share on other sites
if you mean and effect something like jet set radio for sega dreamcast or the zelda gamecube try looking for a tutorial on cel-shading.
0

##### Share on other sites
Hi there,

I think you could use a 1D texture.

or

Use a mixture of glPolygonOffset and
the stencil buffer.

There was also a link on OpenGL.org for
a non-photorealistic quake which has source
and may be of some use.

Hope its of some help

Mark.

Edited by - MButchers on October 10, 2001 12:14:13 PM
0