PDA

View Full Version : glVertex3f into some sort of matrix?



nick2price
12-25-2008, 05:51 AM
I have been drawing my letters by doing somthing simular this this
glBegin(GL_LINES); //LETTER N

glVertex3f(50.0, 50.0, 0.0);
glVertex3f(50.0, 350.0, 0.0);

glVertex3f(50.0, 350.0, 0.0);
glVertex3f(180.0, 350.0, 0.0);

When my tutor does her letters, she does them like this
w[0][0]=100;
w[0][1]=250;
w[1][0]=250;
w[1][1]=50;
w[2][0]=300;
w[2][1]=100;
w[3][0]=350;
w[3][1]=50;

How would i turn the way i do them, into the way she does them?
thanks

ZbuffeR
12-25-2008, 05:52 AM
search glVertex2fv

nick2price
12-25-2008, 08:51 AM
So do i just take the first two values out of my one and put them into their own array?

Rosario Leonardi
12-25-2008, 01:27 PM
w is an array of point (they are already in their own array).
To draw them you can simply do:


glBegin(yourPrimitiveHere);
for(int i = 0; i < numberOfPointInW; i++)
glVertex2fv(w[i]);
glEnd();