From a467ebc5149d651d73a4522f56775dfd1848c0af Mon Sep 17 00:00:00 2001 From: hasufell Date: Sat, 31 May 2014 18:54:28 +0200 Subject: [PATCH] Draw Points as well for the curve --- src/gl_draw.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gl_draw.c b/src/gl_draw.c index 37f9256..cb3a69b 100644 --- a/src/gl_draw.c +++ b/src/gl_draw.c @@ -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(); }