Archive Pages Design$type=blogging

How to add front screen in your OpenGL Project

In VTU lab for Computer Graphics, developing a mini-project is part of it. While developing CG mini-projects using OpenGL , there is need t...

In VTU lab for Computer Graphics, developing a mini-project is part of it. While developing CG mini-projects using OpenGL, there is need to present the project well. One must add front screen to the project which show the names of college, projects, guides and the project developers. It is good to have front screen as it provides introduction of the project.

There are many ways of adding front screen to the project. Here I explains, the basic way of adding front screen to the mini-project. Typically what looks in the picture below. Let's get started.

front screen in OpenGL mini-project

Simple keyboard interaction to start with

First set a variable, initialized it to zero.        
int flag=0;

Write a function called frontscreen, which contains all the details which you want to display.

void frontscreen(void)
drawstring(20.0,90.0,0.0,"NAME OF THE COLLEGE ");
drawstring(38,70,0.0,"A MINI PROJECT ON");
drawstring(40,60,0.0,"PROJECT TITLE");
drawstring(10,40,0.0,"NAME FIRST           (USN)");
drawstring(10,34,0.0,"NAME SECOND         (USN)");
drawstring(63,40,0.0,"GUIDE NAME FIRST");
drawstring(63,34,0.0,"GUIDE NAME SECOND");
drawstring(32,10,0.0,"PRESS ENTER TO START");

Next is to write the code for the keyboard interaction which let user start the program. As in our case we have taken 'enter' key as our starting point. So when user press the 'enter' program leave the front page and start executing the main part of the project. Different keys may be assign for this job. Let's code a function called
myKeyboardFunc. This function will set flag value to 1  if the assigned key is press, thus making the way for displaying the main ideology of project.

void myKeyboardFunc( unsigned char key, int x, int y )

case 13:if(flag==0) //Ascii of 'enter' key is 13

mydisplay() function is called which will display the program execution on the screen. In this function we check the flag value and display according to that. If flag is not set to 1 (mean user has not pressed the key assign to start), front screen will display and if it set to 1 (mean user had started the program by pressing assigned key), the project will execute for what it is mean for. The code is simple as given below.

void mydisplay(void)
frontscreen ();

The display() called above should contained and properly designed (coded) according to the requirement of the project. Functions need to be adjusted as one develop the project, so precaution must be taken and adjustment can be made to codes to make sure project work properly.

Note :  drawstring in above will display the strings so proper function need to be call for this. Also make sure  you must call 'glutDisplayFunc(mydisplay)' and 'glutKeyboardFunc(myKeyboardFunc)', in main function. Also do not confuse with display and mydisplay in main.



3D Bi-Cycle 3D Game 3D Laptop 3D Objects 3D Projects 3D Zoo Algorithm Android Aquarium Bellman-Ford Algorithm B├ęzier curves Block Breaker Blockshooting Bucket Sort C# Chess Clock Code Blocks Colors Complex Project Complex Projects Crab Pong Cross Zero Doll DSAV Escapa Fighter Jet First Come First Serve Flag Flag Hoisting flag of usa Fluids Font Demo Games Gear Motion GlutDino Glutplane Graphics Editor iOS iPhone Java Java OpenGL Graphics Programming Light Torus Linked List Ludo Board Game Mancala board games Martyr’s Monument Memory blocks game Memory Game Menu Mickey Mouse Minesweeper Miniature Steam Engine moth Motion Blur MoveLight moving car Moving Ship Multiplex Networking Based Project Nuclear Power Plant Olympic opengl c++ examples OpenGL ES OpenGL Programming OpenGL Tutorial Origami OS Based Projects Paint Paper Folding Particles Drop Path Finding ping pong Pong Game Project Report Projects Report Puzzles qix like Queuqe Random Flowing lines Ray Rigid Body Rings Robot sample c++ opengl code Screen Saver Screen Saver Ship Shadow Cube Shadowfun Shaheed Minar Ship Iceberg Simple Drawing Simple Haloed Lined Wireframe Simple Move Light Simple Project Simulation SNAKE XENZIA GAME Solar system Sorting Space Invaders Sphere Spot Light Swing Stack Stars Taj Mahal The Edge Game Tic Tac Toe Tower of Hanoi Traffic Signal Transformation Triangular Animation Trippy Tutorial water ripple effects Whirlpool
OpenGL Projects: How to add front screen in your OpenGL Project
How to add front screen in your OpenGL Project
OpenGL Projects
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago