Results 1 to 5 of 5

Thread: repeating lines???

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    allston Ma
    Posts
    8

    repeating lines???

    Hi

    Here is the code that I have been working on for the last few hours....I know that I have to use a for loop to make my lines repeat, but how do I go about doing this?

    void DrawPixel( int x, int y )
    {
    glBegin( GL_POINTS );
    glVertex2f( x,y );
    glEnd( );
    }

    void DrawLine( float x0, float y0, float x1, float y1 )
    {
    //-------------------------------------------
    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    // repeatedly call DrawPixel from this function
    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //-------------------------------------------

    for(????)


    glutSwapBuffers( );
    }

    thank you ALLL for everything!
    I wish I caould buy you all Drinks!

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: repeating lines???

    Are you drawing straight lines?
    why not use GL_LINE etc.?

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    allston Ma
    Posts
    8

    Re: repeating lines???

    Hi Gavin,

    thanks for the reply, and I am drawing straight lines. How do I go about using GL_Lines???

    ahhh!!!!!

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    allston Ma
    Posts
    8

    Re: repeating lines???

    Actually, I need to use drawpixel and use my DrawLine function to call drawpixel repeatedly so that can just press a key and have that line repeat over and over....

    *sigh*

    cal

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: repeating lines???

    glBegin(GL_LINES);
    glVertex3f(sx, sy, sz);
    glVertex3f(ex, ey, ez)
    glEnd();

    Obviously you can repeat this as many times as you want.

Similar Threads

  1. repeating world
    By Fezziiwig in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-22-2013, 07:30 PM
  2. map a repeating texture to glucylinder(...)
    By m_code in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 06-09-2010, 01:38 AM
  3. Repeating sub texture images
    By crouchingchicken in forum OpenGL: General
    Replies: 13
    Last Post: 03-03-2007, 11:18 AM
  4. repeating textures
    By jagz_iiit in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-09-2004, 04:00 AM
  5. Repeating Texture
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-15-2001, 01:47 PM

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