use Bezier Curve to create highroad or freeway

Started by
0 comments, last by AndyEsser 17 years, 5 months ago
Hi: I intent to create highroad or freeway using Bezier Curve .For example, if you give some points randomly, then the road will be created manually.Anyone have good ider to do it. Also, I have a problem with simple procedure.The code is this: glColor3f(1.0f, 1.0f, 0.0f); glLineWidth(2.0f); glBegin(GL_LINE_STRIP); for (int i = 0; i <= 30; i++) { glEvalCoord1f((GLfloat) i/30.0); } glEnd(); glPointSize(5.0); glColor3f(1.0, 1.0, 0.0); glBegin(GL_POINTS); for (i = 0; i < 4; i++) glVertex3fv(&ctrlpoints[0]); glEnd(); The problem is we can see the control points,but don't can see curve.why? Thanks a lot!
Advertisement
Without knowing more about Bezier curves myself it looks to me like all you're doing is drawing the points anyway with your GLBegin(GL_POINTS) line of code.

This topic is closed to new replies.

Advertisement