Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > 2D matrix

Reply
Thread Tools

2D matrix

 
 
Mike
Guest
Posts: n/a
 
      04-30-2010
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[i][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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Matrix operations on character matrix element? Robert Kern Python 0 04-02-2009 12:27 AM
Re: Matrix operations on character matrix element? Terry Reedy Python 0 04-02-2009 12:12 AM
Matrix*Vector and Vector*Matrix Holgerson C++ 3 10-26-2007 07:38 AM
Matrix composed by two matrix lvcargnini VHDL 3 07-05-2006 07:21 AM
Re: Matrix DTS and Matrix 2 DTS? PeterTHX DVD Video 0 08-03-2003 05:46 AM



Advertisments