2D matrix

Discussion in 'C++' started by Mike, Apr 30, 2010.

  1. Mike

    Mike Guest

    Hi
    how would i draw/access x/y?
    ------
    void createMatrix(void) //random x/y points
    {
    for(i=0;i<25;i++)
    {
    int temp1 = rand()%25;
    matrix[temp1][j]=temp1;

    for(j=0;j<80;j++)
    {
    int temp2 = rand()%80;
    matrix[temp2]=temp2;
    }
    }
    }

    draw those random points:
    for?
    draw x? y?
    glTexCoord2f(1, 1.0f); glVertex2f(i+15+PanelLeft, i-15+PanelLeft); //
    Bottom Right Of The Texture and Quad
    glTexCoord2f(0, 1.0f); glVertex2f(i+PanelLeft, i-15+PanelLeft); //
    Bottom Left Of The Texture and Quad
    glTexCoord2f(0, 0.0f); glVertex2f(i+PanelLeft, i+PanelLeft); // Top
    Left Of The Texture and Quad
    glTexCoord2f(1, 0.0f); glVertex2f(i+15+PanelLeft, i+PanelLeft); // Top
    Right Of The Texture and Quad

    Thanks
    Michael
     
    Mike, Apr 30, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    2
    Views:
    2,351
    joris
    Mar 24, 2010
  2. lvcargnini

    Matrix composed by two matrix

    lvcargnini, Jul 4, 2006, in forum: VHDL
    Replies:
    3
    Views:
    2,720
    Jonathan Bromley
    Jul 5, 2006
  3. Holgerson

    Matrix*Vector and Vector*Matrix

    Holgerson, Oct 25, 2007, in forum: C++
    Replies:
    3
    Views:
    436
    Holgerson
    Oct 26, 2007
  4. Terry Reedy
    Replies:
    0
    Views:
    587
    Terry Reedy
    Apr 2, 2009
  5. Robert Kern
    Replies:
    0
    Views:
    624
    Robert Kern
    Apr 2, 2009
Loading...

Share This Page