Tuesday, August 19, 2014

Noof : the external - opengl projects using visual c++

Today we are going to see Opengl projects using visual c++ that is quite interesting. This computer graphics project is something different from all other we have mentioned in this blog. You can see the pic below.


You must have not noted much about it viewing the image and determined it as simple project to submit for your VTU but it is not. It is one of the good project that has a lot of potential to show, how much you know about the OpenGL. As in the image you see nothing that attract, but there more in this than simple solar system project. When you execute this projects in using visual c++ (MS visual studio) you will got to see the real potential. 


Noof the external is the name of this opengl project. We have coded opengl projects using visual c++. On execution the leafs will move, turn and twist from different part of screen. It likes the rocket when leaves the cloud in the sky. You got see like same as it fill the entire screen with cloud of leaves twisted motion. As the petals of flowers twist to form a beautiful object we are going to see same here. We have paired object shapes that form foam of cloud in the screen. Watch the video at vine to see how it actually works. 

This opengl projects using visual c++ has used many things like using the colors vectors, motion vectors to control how the object form and have it's motion with it. The use of glShadeModel and glBlendFunc is also crucial. 

Wednesday, August 6, 2014

Tetris game projects in Opengl computer graphics

There are many computer graphics games projects in the opengl. We have discussed many of them like ludo, snake xenia, mancala etc. Here are we have a new game projects in computer graphics. You may remember the childhood video game where we play the game of tetris. Here we are going ti implements the game of tetris in Opengl computer graphics.

The project is some what complex but not long. It has fewer lines of code. Logic is to have the function that define a random change of blocks or the shapes when key is press . With key press the angles are changes and hence the shape of the blocks are determines in each key press. The change is also selective and act on chosen shapes, means a shape of of long line may have four block in horizontal and vertices and no other shapes. The color is also randomly selected while for shapes changes it remain same. 

Tetris game projects in Opengl computer graphics


Keyboard Interaction -

Up arrow key - changes the shape in positive direction of angle
Down arrow key -  changes the shape in negative direction of angle
Right arrow key - move the blocks to right
Left arrow key - move the blocks to right
Esc - Closed the program

The important feature that this project lac is the disappearance of blocks as the line get filled. While timers and scores can be added in future to this projects along with sounds in the Opengl computer graphics.

I hope this computer graphics games projects would helped you in CG course or other ways. Download the source code Tetris game projects in Opengl computer graphics and comments for any query, problem, suggestion or alteration.

Tuesday, July 15, 2014

OpenGL Project on Binary Tree

In C/C++ Binary Tree is one of the tree data structure in which each node has at most two children. These data structure has two child -right node (right child) and left node(left child). In a binary tree, the degree of each node can be at most two. You can read more about binary tree on wikipedia.

As we have different operation with binary tree in c/c++, same operations can be done as demo in this projects. This OpenGL Project on Binary Tree, the elements are taken as input from the user which then form the Binary Tree according to the rule. See the image below which show how the a binary tree formed with sample input.

OpenGL Project on Binary Tree

How the Project works? It's the big question for all. It used the structures with 3 nodes input -left, right and parent. The structure also has data as the element for that very node. The input is taken from the user using the primary cin function in the console. The input is recorded and it is arranged in the order of the rules of binary tree. One condition put in this project to determine the termination is that last input should be 0.

The OpenGL Project on Binary Tree

Download the Project

Wednesday, July 2, 2014

New graphics editor Opengl mini Projects

We came across with graphics editor Opengl mini Projects in our earlier post. In this post we are going to see new graphics editor project. It is similar to in work with the previous project but an advance version. It is also a replica of MS paint provides many options that are not in the previous projects like - Triangle, Square, Cricle, Parallelepiped,Pencil, Ellipse etc. These extra option like Triangle standalone draw the figure so you need not to work on the line most of the time, one click figure, thus saving the time.

New graphics editor Opengl mini Projects


Before we go on to the functionality let's clear about the few feature of this Opengl mini Projects.

1. The whole application has three user interface block - first the figures selectors (tools), second draw panel, third and last the color panel for selecting the specific color.
2. There are range of figures or tools to choose - LINE, TRIANGLE, SQUARE, ERASER, CIRCLE, EXIT, CCTRIANGLE, CCSQUARE, CYLINDER, BULLET, PARALLELEPIPED, SPRAY, MESH, TEXT, PENCIL, BRUSH, ELLIPSE, CLEAR. All these tools are having functionality as per their name.
3. The TEXT tool allows to have text typed rather than drawing it. There is no option for font family and sizes.
4. The color option having many shades to choose for the drawing. The only thing that lack is the color eavesdropping.
5. In the Draw panel we can see different shapes that can be drawn there by moving the mouse with the tools selected in appropriated color.
6. The last Exit button in the tools allows to close the program.

This Opengl mini Projects uses the important glut functions, that I am going to discuss here. The function are - glutMotionFunc() and glutPassiveMotionFunc(). These functions provides for the motion detection of mouse.It is similar like we detect the mouse click with glutMouseFunc(). The glutMotionFunc() detects the active motion (mouse is moved and button is pressed) while the glutPassiveMotionFunc() detects passive motion (mouse is moved but button is not pressed).

The signatures for the GLUT functions are as follows: 

void glutMotionFunc(void (*func) (int x,int y)); 
void glutPassiveMotionFunc(void (*func) (int x, int y)); 

Parameters: func - the function that will be responsible for the respective type of motion. 

The parameters for the motion processing function are the (x,y) coordinates of the mouse relatively to the upper left corner of the window's client area.

The Mouse click and motion are the major functionality of the project while we have figure predefined with primitive calls. Color selection and display uses the array. Keyboard function for entering the text when text tool is selected. There are whole bunch of things there. 

How you like this project? Download the source code of the project and do comments about it in the comment box.

Download Advance graphics editor Opengl mini Projects

Friday, June 27, 2014

Getting Started with OpenGL ES for Android

Earlier We are Focusing on Small Application based on OpenGL, Now we will go for the OpenGL ES. It is industry used graphics library. Today we would Getting Started with OpenGL ES for Android. As we all know Android is getting more and more important day by day, as we see new Android L from Google I/O. Graphics is important for Android as we have so many apps on it. Get started with OpenGL ES graphics library learn how to use it in Android.

Setting up OpenGL ES For Android

You can also make sure no one install the application from Google Play on a device not supporting OpenGL ES 2.0 by adding a uses-feature in the AndroidManifest.xml.

<uses-feature android:glEsVersion="0x00020000"  android:required="true" />

Updating Soon