Search Projects

Showing posts with label 3D Projects. Show all posts
Showing posts with label 3D Projects. Show all posts

Thursday, March 1, 2018

3D Martyr’s Monument -Shaheed Minar

A Very Good 3D Project on Martyr’s Monument (Shaheed Minar) Submitted by Nayeem. It is a 3D Computer Graphics OpenGL projects based on Bangladesh Shaheed Minar or Martyr’s Monument.

Note : - This Projects is submitted by Nayeem through the Submit Your Project which you can too submit as well.



Introduction:

Martyr’s Monument (Shaheed Minar) is based at Dhaka, it was projects idea of teacher of Nayeem from Ahsanullah University of Science and Technology Dept. of Computer Science and Engineering. It is wonderful projects based on the ideal martyrs monuments. It is also a tribute for martyrs and to remember them by laying down flowers to the Martyr’s Monument.

Tools:

For this lab Project, they have used the OpenGL 3. The GLUT library has bee used to access OpenGL function. The basic concept from OpenGL which envolve this 3D Martyr’s Monument project are as follows -
  • Transformation
  • Timer
  • Color
  • Lighting
  • Textures
  • 3d text



Feature: Now we will discuss about the features of this project which are as following -

  • The project showcase the Shaheed Minar Structure of Dhaka with the perfect scale.
  • The structure was design this architecture with perfection with compute graphics using opengl.
  • Different texture like grass, sky and tiles used in this program to give more realistic look.
  • There are two mode in the project which show the structure in Day and Night Lighting combination.
  • There is an option to rotate Shahid Minar at 360o.
  • It also have text display in 3D.

  • Obstacle:

    The main Challenge in completing the project was to find the right coordinate to draw plane for object surface. It was really very challenging finding original coordinate display it perfectly.

    Future work:

    • Add City View and flower dropping on base.
    • Add many peoples around the structure who pay homage by flowers etc.
    • Add boundary and other stuffs.
    • Add more animation to the project.
    • Add sound and music to the project.


    Download:

    You can download the source code of the project from Github as well as report from there.


    Sunday, January 22, 2017

    3D Bouncing Balls gl programming

    GL Programming is programming with use of opengl graphics library. OpenGL API contains several functions, which helps rendering 2d/3d image as graphics on computer. It is designed to streamline the process of rendering the different objects on computer screen. One of the best part that OpenGL has over DirectX is that, OpenGL is hardware/OS independent.

    Computer Graphics in few decades have grown from 8 bit simple games to large scale scientific research. Now we see in every aspect of life including images, videos, games, application etc there is intense use of graphics. OpenGL and other various graphics API evolves and make our life easier.
    In this post we are going to create a 3D bouncing ball program in opengl using C/C++. You can also get this free computer science projects with source code download.

    The GL Programming

    GLU OpenGL Utility Library and GLUT - The OpenGL Utility Toolkit, have so many features which helps in gl programming. They are standard part of OpenGL implementation, helps in writing programs.

    gl programming opengl and glut overview


    With gl programming we can do many things including drawing a simple triangle to a large scale complex graphics game. OpenGL considers points, lines, polygons, images, and bitmaps to be primitives or basic elements. With the combination of these elements many complex figures can be obtain.

    There are various aspects of GL Programming -
    • Include necessary headers files
    • The functions, methods or commands of opengl starts with gl e.g - glBegin, glEnd etc.
    • In gl programming window management is done via main function which all other related functions.
    • OpenGL do rendering, pipe lining, pixel operation, rasterization, texturing, fragmentation, animation, interactive operations etc.
    • OpenGL operates in different modes or states.
    • OpenGL works on buffers (memories) to display the objects

    3D Bouncing Balls

    In this post we are going to create a opengl program that will show 3D bouncing balls. Now in detail we are going to tell you what are our objective or aim for coding this gl program.

    What we are developing?

    First the floor is drawn which is a checkerboard, most likely similar to our opengl chess board program. Then we will draw three balls, of different colors. These balls will bounce up and down on the floor. To make the program or interesting, the user interaction has been added to it. With the help of four navigation key, the floor as well as ball, the whole system can be zoom in/out and can also be move around - simply say moves the camera in different directions - swinging the camera around.
    Basically, we are creating an application which shows the balls bouncing on a floor. The animation which make application more interesting, with arrow keys move the camera.

    PROJECT MODULES

    Apart from the basic modules of a gl programming i.e header files, main function this application has basically in 5 modules. We have defined global array for Colors to be used for balls and floor.
    // Colors
    GLfloat WHITE[] = {1, 1, 1};
    GLfloat RED[] = {1, 0, 0};
    GLfloat GREEN[] = {0, 1, 0};
    GLfloat MAGENTA[] = {1, 0, 1}
    
    1. CAMERA CLASS - This class will define the methods (functions) that are to be used for movement of camera. The camera moves horizontally in a circle centered at the origin of radius 10. It moves vertically straight up and down.
    Here some use of trigonometry comes as we apply the formula with sine and cosine functions from opengl. The variables are defined which will store the position of the camera, it's x-y-z positions. The swing or motion of camera done via the angle, which determine x,z position. Angle will help movement of camera in and around. While the value of y coordinate helps in moving camera up and down.
    The functions prototype here will get the information and determine the position of x, y, z coordinate of camera. Also prototype will define animation, movement in four direction - up, down, left and right.

    2. BALL CLASS - All the variable and prototype function declared for the balls. A ball has a radius, a color, and bounces up and down between a maximum height and the xz plane. Therefore the x and z coordinates of the balls are fixed. It uses a lame bouncing algorithm, simply moving up or down by a mere 0.05 units at each frame.

    The prototype of function that will draw the ball will have following parameters - radius, color, x, y, z. Here x-y-z are coordinate positions. The ball is given a good shape with call of glutSolidSphere .

    3. CHECKERBOARD CLASS - We all know a checkerboard is one with alternate square of two different color. This class will define methods and variable for checkerboard. The number of squares in the checker board is set via constructor. Each of the square in checkerboard is 1 x 1 unit. The one of it's corner is (0, 0) and the board stretches out along positive x and positive z directions. It rests on the xz plane.

    We have used the concept of Display list in this class to draw the checkerboard. Other like giving the checkerboard lighting, material, ambient opengl function has been called.

    4. DISPLAY - Though display is necessary for every application in gl programming, we had called it a separate module. Like all other gl programs, here we define to draw the objects on the screen.

    Here we draws one frame, first the checkerboard and then the balls, from the current camera position.

    5. USER INTERACTION - Without user interaction the program look dull, hence we have added user interaction to this program with special function (just named so).

    The table below will show keys used for user interaction and their uses.

    KEY USES
    up Move camera up/zoom in
    down Move camera down/zoom out
    left Move camera left
    right Move camera right

    Keys as said above will moves the camera according to the key pressed. The glutPostRedisplay(); then ask to refresh the display.

    FINAL THOUGHTS

    In this 3d bouncing ball gl programming, a timer is also there which requests to draw the next frame. Also the size of the ball and colors are hard-coded which can be change with global array. Similarly size and color of checkerboard is hard-code which also can be changed via program.  We have used navigation key for user interaction, you may like to code any key as per your choice.

    The following video will show demo or output of this gl programming. We also states some of the modification you can make in the program. 

    Download the source code from Google Drive.

    Thursday, March 3, 2016

    3D Laptop Computer Graphics Programming in C

    We have provided so many 3D opengl programs, today we are going to show you 3D Laptop Computer Graphics Programming in c.

    What is CG Programming?

    According to wikipedia  - "Cg (short for C for Graphics) is a high-level shading language developed by Nvidia in close collaboration with Microsoft for programming vertex and pixel shaders." Know more about the CG programming visit various sources including Nvidia.

    Computer Graphics Programming in C

    What is computer graphics programming? Computer graphics Programming is high level programming in various languages including C/C++. This programming teaches how to use the computer GPU and accelerate it for drawing various real object on computer screen. CG Programming is basically is done to convert real time object into computer graphics object. Like we are going to convert Laptop into an computer graphics object in this post via Computer Graphics Programming in c. There are many graphics library available to help and develop many programs through CG Programming. OpenGL library is one of them, which we are using our programs. There are many 3D projects including the 3D Bi-Cycle Computer Graphics Programming in C, 3D Robot OpenGL Program, 3D car racing game, Egg games etc. In all the above program we have used the C/C++ with OpenGL and came out with some fantastic project. We requested many of you to submit project you have developed, this 3D Laptop Computer Graphics Programming in c, is being submitted by one of our user. His name is Varun Sharma. He has developed this very good working 3D Laptop with so many features.

    3D Laptop Computer Graphics Programming in c


    Features of the Project -
    •  The laptop can be rotate along in x,y and z axis.
    • The Lid of the Laptop can be open/close.
    • Turn the screen of the laptop on/off.
    • Good looking 3D keyboard.
    • Show Text (Your name) on the Laptop Screen.


    You can Download the 3D Laptop sample exe (for testing only) file by clicking the link given below -

    3D Laptop – OpenGL CG project


    You too can post you free or paid Project Here, Please Contact us.

    Wednesday, February 24, 2016

    3D spinning Cube gl programming

    OpenGL programming is also know as gl programming. OpenGL is not a programming language rather it is API which allow other programming languages ton exploit and develop computer graphics objects.

    Overview of  gl programming

    Before going to talk about the main project we are first talk the following question. This question comes in mind of all opengl learners.
    What is  gl programming?
    gl programming is the use of opengl api to develop games, 3 objects etc via computer graphics. The  gl programming is to create the program with the help existing language and rendering the objects with api provide in OpenGL. The base of  gl programming is Opengl - open computer graphics library. With the help of  gl programming we can do things like developing a games for pc, mobiles and other devices. It also helps in different sectors for research and implementation like scientific research, weather, medicines, card and architecture designs.

    3D spinning Cube

    In this post we will cover the 3D spinning cube. As we all know that a cube has 6 faces, we will color the different faces in different colors. The 3d spinning cube will be fully colorful. The cube will look good and it will make full use of computer graphics.
    Note - VTU students have two programs on Cubes in the syllabus.

    3D spinning Cube gl programming

    Design the Cube and Spinning

    To design the cube in opengl we need to make use of simple functions. Let go to code a cube in OpenGL. First we need to define the vertices of the cube and then color for each of it sides.

    /*Matrix for the vertices of Cubes*/
    static GLfloat vert[][4]={
    { 1.0, 1.0, 1.0},
    {-1.0, 1.0, 1.0},
    {-1.0, -1.0, 1.0},
    { 1.0, -1.0, 1.0},
    { 1.0, 1.0, -1.0},
    {-1.0, 1.0, -1.0},
    {-1.0, -1.0, -1.0},
    { 1.0, -1.0, -1.0},
    };
    /*Matrix for the color of sides of Cubes*/
    static GLfloat color[][4]={
    {1.0, 0.0, 0.0, 0.0},
    {0.0, 1.0, 0.0, 0.0},
    {0.0, 0.0, 1.0, 0.0},
    {0.0, 1.0, 1.0, 0.0},
    {1.0, 0.0, 1.0, 0.0},
    {1.0, 1.0, 0.0, 0.0},
    };
    Next is to give translate and rotation to the cube. We code that like -
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glPushMatrix();//push on stack
    glTranslatef(0.0, 0.0, -15.0); //move
    glRotatef(rot, 0.0, 1.0, 0.0); //rotation
    glTranslatef(0.0, 0.0, -5.0); //move
    glRotatef(rot*2, 1.0, 0.0, 0.0); //rotation
    Till know cube is not designed yet for that we have used the GL_QUADS and glVertex. We utilized the vertices and color matrix as defined above to render the 3d cube.
    glBegin(GL_QUADS);
    glColor3fv(color[0]);
    glVertex3fv(vert[0]);
    glVertex3fv(vert[1]);
    glVertex3fv(vert[2]);
    glVertex3fv(vert[3]);
    glColor3fv(color[1]);
    glVertex3fv(vert[4]);
    glVertex3fv(vert[5]);
    glVertex3fv(vert[6]);
    glVertex3fv(vert[7]);
    glColor3fv(color[2]);
    glVertex3fv(vert[0]);
    glVertex3fv(vert[1]);
    glVertex3fv(vert[5]);
    glVertex3fv(vert[4]);
    glColor3fv(color[3]);
    glVertex3fv(vert[2]);
    glVertex3fv(vert[3]);
    glVertex3fv(vert[7]);
    glVertex3fv(vert[6]);
    glColor3fv(color[4]);
    glVertex3fv(vert[3]);
    glVertex3fv(vert[0]);
    glVertex3fv(vert[4]);
    glVertex3fv(vert[7]);
    glColor3fv(color[5]);
    glVertex3fv(vert[1]);
    glVertex3fv(vert[2]);
    glVertex3fv(vert[6]);
    glVertex3fv(vert[5]);
    glEnd();
    In this gl programming example we are not using any keyboard function, nor do we used the mouse function. On execution of the program we will get the colorful cube which rotates or spins around in a path on screen.
    Download  the free Source code
    Give suggestion or any query to us via email to openglprojects@gmail.com.

    Friday, February 19, 2016

    3D Racing Game in OpenGL

    A Slovenian student of University of Maribor has developed 3D Racing Game in OpenGL with the use of - c++, OpenGL, Fmod for sounds, Assimp for loading models and some algorithm for track. I found it while browsing on my YouTube Channel. He has brilliantly coded the game which look like professional one while little improvement can be done on UI and Graphics part.

    We already have shared you 2d car racing game in opengl computer graphics and formula one racing in opengl c++, but this project is very good and other project will able to compete with this 3D Racing Game in OpenGL.

    I din't able to find the source code but only a video demo which I have embedded below. I am trying to contact the person to let him share the code with us, if does we are going to share it with our fellow students who would love to give this a their project.

    I want you guys to try coding this and get something from this output. though this is too complex but with the help of codes provide by me in this blog and your teacher and friends you would be able to come up with some nice result. Do try experiment with code and create magic like this. Hope you will able to do so, and don't forget to share with us as well. Good Luck!

    Watch Video Demo for 3D Racing Game in OpenGL


    Wednesday, February 10, 2016

    3D Bi-Cycle OpenGL Programming

    Before going into OpenGL Programming of 3D Bi-Cycle, let know in brief about OpenGL.

    What is OpenGL?

    OpenGL (Open Graphics Library) is an api use for rendering 2D and 3D graphic. It is cross platform, supports in multiple programming languages. Silicon Graphics originally developed OpenGL in 90's, which is know most used industry standard open graphics. OpenGL uses geometric primitives - points, lines, and polygons in modeling the objects.

    OpenGL Programming

    As we get to know OpenGL is cross platform, hence it can run on any device. OpenGL Programming is used fro developing windows applications, mobile applications and other console applications. You can experience the OpenGL Programming in Android development or iOS Application development, almost all the mobile graphics application on these platform uses the OpenGL to render the graphical objects. The OpenGL Programming can be done in C,C++, Java and other languages.

    Draw 3D Bi-Cycle in OpenGL



    First we need to structures the Bi-Cycle - find different part and create a function for each of them. Finally all the functions can be used in display to show it on the screen. Different parts of Bi-Cycle are - Frame, Gears, Tyre, Chain, Pedals and Seat. Draw Frame Since a Bi-Cycle Frame consists of different part so it need to be drawn by using different primitive objects. Road of the Bi-Cycle is in cylindrical form so we have formed two function - Xcylinder and ZCylinder. These two functions take the parameter - radius and length.