Search Projects

Friday, April 6, 2018

OpenGL Code Traffic Signals

Presenting to you another OpenGL Code on Traffic Signals. We have already seen the Advance Traffic Signal OpenGL Program, now we will see another good program for same.


OpenGL Code Traffic Signals

Features 

The OpenGL Code  we presenting have many of the good features. Some of the features is listed below -

  1. Light Options - As in any traffic signal you will see the three lights - red, yellow and green. All the options has been implemented.
  2. Vehicles - To keep the OpenGL Code simple for all only three vehicles has been added. Though, if you like to add more do it, you are welcome.
  3. Lanes -  The right and left lane options is implemented in the program.
  4. User Interactions - Both mouse and keyboard interaction has been added to the OpenGL Code. All the user interactions has been listed in the post below.
  5. There is options to speed up the traffic is also in the code.
  6. Program has include the front page for introduction.

User Interactions

As mentioned earlier both mouse and keyboard user interaction has been added to this OpenGL Code. 
  • Keyboard Interactions
  1. Enter - From First Introduction screen to screen press Enter key at beginning.
  2. Help -  Press 'h'to get the help screen.
  3. Left to right movement - press 'l' to allow only left to right movement of traffic.
  4. Right to left movement - press 'r' to allow only right to left movement of traffic.
  5. Speed up - To speed up the traffic press 's'.
  • Mouse Interactions
  1. Left Mouse Button - This will stop the traffic as Red light gets on.
  2. Right Mouse Button (on hold) - Press right mouse button and keep on hold for yellow light. 
  3. Right Mouse Button (released) - After releasing the right mouse button the light changes from yellow to green and traffic moves.

Video Demo


Downloads

You can download the OpenGL Code from the Google Drive link.

No comments:

Post a Comment