road traffic simulator

How can i make a small rectangle(car) follow a path(road) which is not straight,with curves…?
Please let me know about any animations possible using GLUT or basic OpenGl itself concerning the topic above

  1. This has nothing whatsoever to do with OpenGL. It’s a drawing API. Animation is up to you.

  2. Assuming you have a set of points for the road path which can be interpolated using splines or the like, add another point to represent the car’s position and set it based on one or more samples from that path, with the sampling offset increasing over time. Feed the result into glTranslate. Find the tangent angle of the road path at the sample point and feed it into glRotate. Draw a rectangle.