Hi everyone! I need your help
Im trying to draw multiples lines with glBegin(GL_LINE_STRIP); right?
For this, i have 2 class
1.
Class1::Class1(float x, float y, float z)
{
xS = x; /* xS is a float */
yS = y; /* yS is a float *
zS = z; /* zS is a float *
}
Class2::Class2(float x1, float y1, float z1)
{
xT = x1; /* xT is a float */
yT = y1; /* yT is a float *
zT = z1; /* zT is a float *
}
Two class have getter and setter methods.
And i have 2 QVector
1. QVector<Class1*> clas1Vector; /* any object in the vector contain 3 values: x, y, z*/
1. QVector<Class2*> clas2Vector; /* any object in the vector contain 3 values: x1, y1, z1*/
and i have 2 iterator, obviously:
1.
QVector<Class1*>::iterator is;
for (is = clas1Vector.begin(); is != clas1Vector.end(); ++is)
{
x = (*is)->getXS();
y = (*is)->getYS();
z = (*is)->getZS();
}
2.
QVector<Class2*>::iterator it;
for (it = clas2Vector.begin(); it != clas2Vector.end(); ++it)
{
x2 = (*it)->getXT();
y2 = (*it)->getYT();
z2 = (*it)->getZT();
}
okay, now its my question: How can i draw lines with glBegin(GL_LINE_STRIP); without deleting or replacing the previous line? That is, when drawing a new line, the previous one do not erase.
Actually draw the lines so:
glBegin(GL_LINE_STRIP);
glColor3f(0.0f, 1.0f, 0.0f); // Green
glVertex3f( x, y, z);
glVertex3f( x2, y2, z2);
glEnd();