Results 1 to 2 of 2

Thread: Wire box not closed

  1. #1
    Member Contributor
    Join Date
    Feb 2001
    Sydney, NSW, Australia

    Wire box not closed

    I seem to be having a little problem drawing a simple wire box(code below). For some reason one of the corners of the box is not finished, the top left. Imagine the corner pixel removed.

    I have tried recoding this as GL_LINES but the result was exactly the same. Is this me or a buggy driver?

    glVertex2f(a_X, a_Y);
    glVertex2f(a_X + a_Width, a_Y);
    glVertex2f(a_X + a_Width, a_Y + a_Height);
    glVertex2f(a_X, a_Y + a_Height);
    glVertex2f(a_X, a_Y);

    [This message has been edited by gimp (edited 10-19-2003).]

    [This message has been edited by gimp (edited 10-19-2003).]

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Gastonia, NC, USA

    Re: Wire box not closed

    Well GL_LINES you need a start and end for each segment, so with GL_LINES you would need eight points to form a box.

    The code look's ok, you have five points needed to define a box with GL_LINE_STRIP.

    Could it be something else in your code that is causing the one side not to show up?

    What drawing mode are you using, ortho perspective?

    Maybe post more of your drawing routine.

Similar Threads

  1. Wire framing
    By Jaymz in forum OpenGL: General
    Replies: 3
    Last Post: 01-16-2012, 06:24 PM
  2. wire frame
    By mikeg in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-20-2004, 07:44 PM
  3. Closed volumes?
    By billy in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 12-27-2002, 04:58 AM
  4. wire-models
    By Belgy in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 11-19-2002, 02:54 AM
  5. Closed cylinder
    By weber_ofir in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-20-2000, 07:23 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