Draw Points as well for the curve

This commit is contained in:
hasufell 2014-05-31 18:54:28 +02:00
parent 5afe6e0bda
commit a467ebc514
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -193,13 +193,14 @@ static void draw_bez(HE_obj const * const obj)
{
uint32_t i = 0;
static float line_width = 2;
static float point_size = 10;
glPushMatrix();
glLineWidth(line_width);
glPointSize(point_size);
glColor3f(1.0, 0.0, 0.0);
while (i < obj->bzc) {
glBegin(GL_LINE_STRIP);
for (uint32_t j = 0; j <= obj->bez_curves[i].deg; j++) {
@ -211,6 +212,18 @@ static void draw_bez(HE_obj const * const obj)
i++;
}
i = 0;
while (i < obj->bzc) {
glBegin(GL_POINTS);
for (uint32_t j = 0; j <= obj->bez_curves[i].deg; j++) {
glVertex3f(obj->bez_curves[i].vec[j].x,
obj->bez_curves[i].vec[j].y,
obj->bez_curves[i].vec[j].z);
}
glEnd();
i++;
}
glPopMatrix();
}