Sign in to follow this  
huaner

use Bezier Curve to create highroad or freeway

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this