Search code examples
c#openglsharpgl

Outline a 3D model correctly


I'm currently working on a simple 3D select Screen using SharpGL. It looks like this:

Puzzle without outlines

So far it looks allright, but I need to get it the puzzles outlined somehow, so it looks more like this:

Puzzle with outlines

I tried increasing the space between the individual puzzles, but it looks very ugly.
Does someone has another idea how to outline the individual puzzles?
Different colored puzzles is unfortunately out of the question.

Heres the Pic with the Spaces between the geometry:
http://oi59.tinypic.com/smc6sl.jpg

I used a Shader for the lighting, because it looks a bit better.

Heres the Blender wireframe:
http://oi60.tinypic.com/6yljis.jpg


Solution

  • You should draw lines by yourself using GL_LINES.

    gl.LineWidth(3.0f);
    gl.Begin(OpenGL.GL_LINES);
    gl.Vertex3(2.0f, 3.0f, 4.0f);
    gl.Vertex3(2.0f, 3.0f, 4.0f);
    ...
    gl.End();