Search Projects

Wednesday, April 29, 2015

Mickey mouse using OpenGL computer graphics and animation

Everyone likes Mickey Mouse whether we are child or not. Today we are going to draw Mickey mouse using computer graphics and animation.

Mickey Mouse is most anticipated cartoon character throughout the world. It was created in 1928 by Walt Disney and Ub Iwerks. It is also the mascot of Walt Disney. There are many cartoon and animated movies being made and get popular with children. 

We have seen many of the drawing programs like Taj Mahal, today we are going to draw the funny Mickey mouse face with computer graphics and animation. Since it is the beginning for those learning computer graphics or animation via it, this program is simple as compare to the cartoon we see on TV.  You can view that in the image below, what we are drawing.


What this drawing programs do?


We are drawing a simple face of Mickey Mouse with little animation. The whole program is divided into different modules each defining the different parts of face. The Code accomplished with the comments which indicate what part it drawing. The no of lines of code is very less, hence easy for you all in understanding this program.

As you execute the program, first two ears will come and then the face in slow animation. Finally the eye, nose and mouth will appear. The animation is smooth as we are drawing a simple program. This computer graphics and animation don’t have any keyboard or mouse interaction. Also this is 2d version of program. The Face outlines and background color both can be easily change with little modification in the code.

Future scope

There are many things that can be added to this program which is listed below -

  • Convert this program to a 3D version.
  • Also add whole body of Mickey Mouse.
  • Make the body more colorful
  • Add animation with user interaction via keyboard and mouse.
  • Sound can also make this project wonderful.


 Hope You liked this simple computer graphics and animation drawing programs, post you suggest and queries in the comments below.


Monday, April 13, 2015

Mini Solar System Computer Graphics Programs



Presenting your C/C++ Mini Solar System Computer Graphics Programs which is executed in Visual Studio. This C++ mini project demo graphically the mini solar system.

What is mini Solar System?

As we all know there are 8 planets (Pluto being exclude to be a planet) in Solar system comprising Sun as it's center point. All planet revolve around Sun in solar system. There are planets in this start system, who owns satellite.

Update Coming Soon......................

Wednesday, April 8, 2015

Wind Mill C++ Projects Download

OpenGL c++ projects with source code
Are you looking for C++ Projects with source code?

Your search for C/C++ projects ends here! This post will give your the C/C++ mini projects which used the core library of OpenGL graphics. You can have this C/C++ Projects Download free from the download link given  at the end of the post.

Everybody know the importance of C/C++ in the computer science filed. Almost every engineer study the language, but only few master it.  For Computer science students learning the C/C++ language is much important, this shape their Carrier. They must master it and able to write programs which includes C/C++  features like functions, arrays and pointers, file handling and data structure, etc.

After mastering the basics of C/C++, you must be able to implement it in some kind of C/C++ projects or mini projects. But, the C/C++ projects or mini projects that features the above mentioned concepts is a difficult task. To solve these difficulty we provides C++ Projects Download. These projects can be use for college work or for final year projects or even as a reference for you research or learning process.

OpenGL is a open source graphics library which allow us to render real world objects in to computer graphics with C/C++ (can be use with other languages as well). Here our project will focus more on graphics than normal C/C++ programs. In this post we are going to talk about the Wind Mill C++ Projects with free source code download.

Wind Mill C++ Projects Download

Objective of Wind Mill C++ Projects


Every Project aim toward something, they have come core idea which need to be implemented. This Wind Mill C++ Projects is aimed to show generation of electricity via wind (renewable energy source). Basically it used the concept of wind energy in computer graphics with C++.

As you can see in the image, there is wind farm with a power house and few wind turbines. Cloud Can be seen in the sky as well. As the wind flow the speed of cloud increase (this used to show wind is flowing, air is invisible to us). Wind can flow in either direction, so the turbines blade will also move in the same direction as of the wind.

User Interaction Wind Mill C++ Projects

This C++ Projects used the mouse interaction to communicate between the computer and the user.  Right click the mouse button to see the options. Detail is shown in the table below.


MenuUses
No WindThere is no wind Flowing
Wind CWWindow Flowing in the Clockwise direction
Wind ACWWindow Flowing in the Anti-Clockwise direction
Fast Wind CWWindow Flowing Faster in the Clockwise direction
Fast Wind ACWWindow Flowing in the Anti-Clockwise direction
QuitLeave the Program

Now turn to have source code - C++ Projects Download free source code

Monday, April 6, 2015

OpenGL Geometric Primitives and Menus

In OpenGL programming we have so many function, methods included in the open source libraries. Most basic thing we need to learn in OpenGL are the Geometric Primitives. In the OpenGL points, lines, polygons, images, and bitmaps are considered to be primitives.

Another major use in OpenGL are the colors, they are used in so many ways and are also very important in OpenGL Programming. We render the object with color using glcolor2f or glcolor3f  etc as required in the program.

Use of the Points in the OpenGL Porgram is very important and it's base for all heavy programming. After the points we have Lines, this OpenGL Geometric Primitive use to draw many 2d and 3d shapes like triangle, rectangles, squares and other polygons with the use of proper vertices coordinates.  We have many Polygon functions also defined in OpenGL graphics API. Only the circle which we need to draw. In today's Program we talk about of  these OpenGL Geometric Primitive.

Learn How to Draw a Circle in OpenGL Programming.

The following program will demonstrate the use of OpenGL Geometric Primitives and Menus. This program is submitted by +venkatesh bandaru. It good to see he share his knowledge with us.  I hope you like the program which will do the following -
  • Allow user to choose different sets of color
  • Let Choose the Primitive like pixels, lines, circle and eclipse.
  • With the combined selection of Color and Primitive objects, it get drawn on the screen.
  • The program used the Concept of Menu and Sub menu for selection, which is done with right click of mouse.
Following the source code -

#include <iostream>

#include <glut.h>
#include <math.h>

struct Point {
GLint x;
GLint y;
};

struct GLColor {
GLfloat red;
GLfloat green;
GLfloat blue;
};

GLColor colors[6] = {
{ 0.0f, 0.0f, 0.0f }, // Black
{ 1.0f, 0.0f, 0.0f }, // Red
{ 0.0f, 1.0f, 0.0f }, // Green
{ 0.0f, 0.0f, 1.0f }, // Blue
{ 1.0f, 1.0f, 0.0f }, // Yellow
{ 1.0f, 0.0f, 1.0f } // Purple
};

GLColor color = colors[0]; // Default: Black

void init() {
glClearColor(1.0f, 1.0f, 1.0f, 0);
glColor3f(color.red, color.green, color.blue);
glPointSize(1.0f);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 640.0, 0.0, 480.0);
}

void display(void) {

}

void draw_pixel(Point p) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(color.red, color.green, color.blue);
glBegin(GL_POINTS);
glVertex2i(p.x, p.y);
glEnd();
glFlush();
}

void draw_dda(Point p1, Point p2) {
GLfloat dx = p2.x - p1.x;
GLfloat dy = p2.y - p1.y;

GLfloat x1 = p1.x;
GLfloat y1 = p1.y;

GLfloat step = 0;

if (abs(dx) > abs(dy)) {
step = abs(dx);
}
else {
step = abs(dy);
}

GLfloat xInc = dx / step;
GLfloat yInc = dy / step;

glClear(GL_COLOR_BUFFER_BIT);
glColor3f(color.red, color.green, color.blue);
glBegin(GL_POINTS);

for (float i = 1; i <= step; i++) {
glVertex2i(x1, y1);
x1 += xInc;
y1 += yInc;
}
glEnd();
glFlush();

}

void draw_circle(Point pC, GLfloat radius) {
GLfloat step = 1 / radius;
GLfloat x, y;

glClear(GL_COLOR_BUFFER_BIT);
glColor3f(color.red, color.green, color.blue);
glBegin(GL_POINTS);

for (GLfloat theta = 0; theta <= 360; theta += step) {
x = pC.x + (radius * cos(theta));
y = pC.y + (radius * sin(theta));
glVertex2i(x, y);
}
glEnd();
glFlush();
}

void draw_ellipse(Point pC, GLfloat radiusY, GLfloat radiusX) {
GLfloat step = 1 / radiusX;
GLfloat x, y;

glClear(GL_COLOR_BUFFER_BIT);
glColor3f(color.red, color.green, color.blue);
glBegin(GL_POINTS);
for (GLfloat theta = 0; theta <= 360; theta += step) {
x = pC.x + (radiusX * cos(theta));
y = pC.y + (radiusY * sin(theta));
glVertex2i(x, y);
}
glEnd();
glFlush();
}

void mainMenuHandler(int choice) {
Point p = { 320, 240 }; // draw_pixel
Point p1 = { 10, 100 }; // draw_line
Point p2 = { 200, 100 }; // --

Point pC = { 320, 240 }; // Circle center point
GLfloat radius = 200; // Circle radius

switch (choice) {
case 1: // Pixel
draw_pixel(p);
break;

case 2: // Line
draw_dda(p1, p2);
break;

case 3: // Circle
draw_circle(pC, radius);
break;

case 4: // Ellipse
draw_ellipse(pC, 60.0f, 200.0f);
break;

case 5: // Exit
exit(0);
break;
}
}

void subMenuHandler(int choice) {
color = colors[choice];
}

int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(200, 200);
glutInitWindowSize(640, 480);
glutCreateWindow("OpenGL Circle and Menus");
glutDisplayFunc(display);
init();

int subMenu = glutCreateMenu(subMenuHandler);
glutAddMenuEntry("Default", 0);
glutAddMenuEntry("Red", 1);
glutAddMenuEntry("Green", 2);
glutAddMenuEntry("Blue", 3);
glutAddMenuEntry("Yellow", 4);
glutAddMenuEntry("Purple", 5);

glutCreateMenu(mainMenuHandler);
glutAddSubMenu("Change Color", subMenu);
glutAddMenuEntry("Pixel", 1);
glutAddMenuEntry("Line", 2);
glutAddMenuEntry("Circle", 3);
glutAddMenuEntry("Ellipse", 4);
glutAddMenuEntry("Exit", 5);

glutAttachMenu(GLUT_RIGHT_BUTTON);
glutMainLoop();

return 0;
}

I hope you liked this simple OpenGL Programming Concept. Do share your view with comments.

Wednesday, April 1, 2015

Singly Linked List OpenGL Computer Graphics Program

C is a simple and easy language, general-purpose, imperative computer programming language. C Programming is vast with so many concept behind it (operators, loops, functions, single and double dimensional arrays, performing operations on strings, files, pointers etc.). One of the key concept which we are going to learn in this post is about Linked List.

Linked list in c the concept which not many of us grab properly. It is very important programming concept in C. There are many Operation in the Linked list, before going to learn about them, I want to tell you we are not giving concept of Linked list in c, but Computer Graphics Program.  Yes we are using the C language as the primary language to write the programm but here we deal with graphics programming and not c programming. You must know about the Linked List in C which is pre-assumed here.  The program uses the OpenGL API to render graphics. Hence it is basically a C or C++ Computer Graphics Program using OpenGL.

Some basic details about Singly Linked List - 

Definition : A Linked list or List is a sequence of data structures (sequence of data linked with each other), which are connected together via links.

Singly linked list is a sequence of items/data/ in which  the items are link to its next element in the sequence. In Singly linked list the item or elements individually called as node. Each node have two parts - Data and Link.

Data(info) − Each Node of a linked list contain or store some data/info. This part of node contain the actual value.
Link − Each link of a linked list contains a link(address) to the next link.

Various operations on Singly Linked list in C

Singly Linked list is a linear data structure with many operations can be done on the nodes unlike the array in C. Various operations that can be done are listed below -
  1. Creation
  2. Insert at starting
  3. Insert at position(user's choice)
  4. Insert at end
  5. Delete 1st node
  6. Delete last node
  7. Delete at position(user's choice)
  8. Display 
 
The source code of the C program to illustrate the operations of singly linked list. Try to learn it first in C then go for graphics program.

Singly Linked List OpenGL Computer Graphics Program


This Computer Graphics Program is operated via two windows as seen in the image. With one we insert the data while graphics is shown in other window. There is some problem in the programm so we need to keep patience in input the data to program. Everything is working perfect if done calmly, while in some PC with less graphics, it may stop working.

Source Code Download

Download source code of Singly Linked List OpenGL Computer Graphics Mini Project from the link given below. Feel free to ask anything about this projects to us via comments or email to us.