Results 1 to 4 of 4

Thread: Thick Outlines

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2007
    Location
    Buenos Aires
    Posts
    3

    Thick Outlines

    Im trying to draw 2D figures with a thick outline.

    I tried to draw them with PolygonOffset and also with the Stencil buffer, but as the outline gets thicker it looses its smoothness and starts to look as a sequence of rectangles.

    Is there any other method to draw 2D figures with a thick outline?

    Thanks in advance

    Gabriel

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Thick Outlines

    Yes. Couldn't resist.

    You could render the outline as QuadStrip generating a mitered wide line, but you need to be very careful about the vertex placements in that strip.

    Here's a really nice but advanced method:
    http://www2.imm.dtu.dk/pubdb/views/e...df/imm4884.pdf

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2002
    Location
    New Jersey
    Posts
    22

    Re: Thick Outlines

    Another option is to use the stencil buffer to render an outline and them blur the outline a little to make it thicker. This is probably a slower than the previous method mentioned but it was the first alternative I could think of.

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2007
    Location
    Buenos Aires
    Posts
    3

    Re: Thick Outlines

    Thanks for the responses, but they seem far ahead of my possibilities (im a newbie by all means).

    With glPolygonOffset I drew the outline first and the solid polygon last and it worked ok (except that i had the problem described in my previous post)

    Now im trying to draw the polygon with glPolygonOffset twice. First with some offset to make it bigger, and then as is.

    But no matter what i pass to glPolygonOffset, I cannot make the bigger polygon appear.

    Im trying something like this:

    glEnable(GL_POLYGON_OFFSET_FILL);
    glEnable(GL_DEPTH_TEST);
    glDisable(GL_CULL_FACE);

    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glPolygonOffset(//any value, //any value);

    //draw blue bigger polygon

    glDisable(GL_POLYGON_OFFSET_FILL);
    glDisable(GL_DEPTH_TEST);

    //draw red polygon

    Thanks

    Gabriel

Similar Threads

  1. Multiple rectangular outlines
    By codeman_nz in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2016, 08:48 PM
  2. Texture Outlines
    By Fezziwig in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 03-21-2012, 11:10 AM
  3. Outlines of a model
    By mphanke in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-02-2002, 05:59 AM
  4. Outlines of glucylinder?
    By billy in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 03-28-2001, 11:04 PM
  5. Outlines to 3D objects ?
    By acfh in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-12-2000, 01:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean