Hello im trying to create a matrix of lines with this way:
Im using glmodel , and it just uses one array to define all the lines or points, for example:
if i have coords[43, 14, 0 , 0 , 24, 44, 0, 0, 42, 33, 0 ,0 52, 23, 0 , 0]
the first value is x , the second one is y, third one is z , fourth one is alpha, the 5th one is x of my second point, sixth is y of my second point and so on.
So if i would like to draw 2 lines that array would mean:
line (43, 14 , 24, 44 )
line2 (43, 33, 53, 23)
Im trying to create an array of lines , ive made the following code:
Code:
float y = 0;
for(int j = 1; j < 6 ; j += 1){
float x = 0;
for(int i = 0; i < 8 * 6 ; i += 8){
coords[i * j ] = x; //x1
coords[i * j + 1 ] = y + 0.2 ; //y1
coords[i * j + 4 ] = x ; //x2
coords[i * j + 5 ] = y + 0.35 ; //y2
x += 0.15;
}
y = y + 0.5;
}
but im getting this:
http://yfrog.com/0smatrizmalp
i would like to get this:
http://yfrog.com/86matrizbienj
anybody have an idea of what im doing wrong?
thanks
Seb.