• Advertisement
Sign in to follow this  

use Bezier Curve to create highroad or freeway

This topic is 4087 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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[i][0]); glEnd(); The problem is we can see the control points,but don't can see curve.why? Thanks a lot!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement