World changes day by day!

Thursday, April 19, 2012

Develop Taj Mahal OpenGL Project in Computer Graphics

33 comments
Taj Mahal (ताज महल), is the symbol of love. It  is a white Marble mausoleum located in Agra, INDIA. It was built by Mughal emperor Shah Jahan in memory of his third wife, Mumtaz Mahal. For more info read wikipedia.

Here, we are going to develop basic structure of Taj Mahal in computer graphics. In this tutorial I will tell how to make Taj like structure using the OpenGL. We will develop simple structure, not exactly same as it looks in real but some what idealistic. This project is mainly mean for the VTU Computer Graphics mini-projects.




Taj Mahal is basically a structure with many minars and gumbazz. We will use the simple objects like spheres and cubes to build these units. First for the main part we use box or a large cube and then point small sphere over them. Thereafter, we place a small cubical structure with very low height, a egg like sphere is also placed over it. Similarly,we going to place four long minars over each four corners.

We are also developing the wired framed structure of the Taj as well. In the wired framed Taj, the large cube block will go transparent and the two tombs will be place in the middle with small cubes.

Lets start coding!



/* Draw the bottom box */
glPushMatrix();
glScaled(0.8,0.04,0.8);
glTranslatef(0.0,-30.2,0.0);
glutSolidCube(7.0);
glPopMatrix();

    //main cube
    glTranslatef(0.0,-.6,0.0);
glutSolidCube(2.0);

//main gumbazz
glPushMatrix();
glScaled(0.8,1.0,0.8);
glTranslatef(0.0,1.5,0.0);
glutSolidSphere(0.8,80,120);
glPopMatrix();

glTranslatef(0.0,1.0,0.0);
glScaled(1.2,0.25,1.2);
glutSolidCube(0.9);

//gumbaz pointer

glPushMatrix();
glScaled(0.03,0.5,0.03);
glTranslatef(0.0,10.8,0.0);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//Minars
glPushMatrix();
glTranslated(2,-1.9,2);
glScaled(.2,10.5,.2);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//minar's sphere
glPushMatrix();
glTranslated(2,0.8,2);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//Minars
glPushMatrix();
glTranslated(-2,-1.9,2);
glScaled(.2,10.5,.2);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//minar's sphere
glPushMatrix();
glTranslated(-2,0.8,2);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();


//Minars
glPushMatrix();
glTranslated(-2,-1.9,-2);
glScaled(.2,10.5,.2);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//minar's sphere
glPushMatrix();
glTranslated(-2,0.8,-2);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//Minars
glPushMatrix();
glTranslated(2,-1.9,-2);
glScaled(.2,10.5,.2);
glutSolidSphere(0.4,80,120);
glPopMatrix();
 
//minar's sphere
glPushMatrix();
glTranslated(2,0.8,-2);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//short Minars
glPushMatrix();
glTranslated(0.6,-0.5,0.6);
glScaled(.2,11.5,.2);
glutSolidSphere(0.2,80,120);
glPopMatrix();

//short minar's sphere
glPushMatrix();
glTranslated(0.6,0.5,0.6);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//short Minars
glPushMatrix();
glTranslated(0.6,-0.5,-0.6);
glScaled(.2,11.5,.2);
glutSolidSphere(0.2,80,120);
glPopMatrix();

glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//short Minars
glPushMatrix();
glPopMatrix();

//short Minars
glPushMatrix();
glTranslated(-0.6,-0.5,-0.6);
glScaled(.2,11.5,.2);
glutSolidSphere(0.2,80,120);
glPopMatrix();

//short minar's sphere
glPushMatrix();
glTranslated(-0.6,0.5,-0.6);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

//short Minars
glPushMatrix();
glTranslated(-0.6,-0.5,0.6);
glScaled(.2,11.5,.2);
glutSolidSphere(0.2,80,120);
glPopMatrix();

//short minar's sphere
glPushMatrix();
glTranslated(-0.6,0.5,0.6);
glScaled(0.3,1.5,0.3);
glutSolidSphere(0.4,80,120);
glPopMatrix();

For More projects and tutorial Visit OpenGL Projects .

This Articles is also cross posted on OpenGL Projects .

33 comments :

  1. please sent me where to download it...
    my mail a.faddly@gmail.com

    ReplyDelete
    Replies
    1. hello sir... iam 6th sem cs student ..can u plzz send me code for any simple and good project using open GL .. plzz mail it to sharanya1994.sk@gmail.com

      Delete
  2. IF You had posted some of the explanation with regards to this you might have got the better responses.

    ReplyDelete
  3. hey how to change the color of taj mahal to white .....

    ReplyDelete
  4. sirplease can send me code for blast furnace .
    My email: sunilg751@gmail.com

    ReplyDelete
  5. can u give ur full code plz..
    my email-id : prakashkumarsdr@gmail.com

    ReplyDelete
  6. sir can u plz send me code fr nuclear power plant

    ReplyDelete
  7. please can you send full code of taj mahal for college project by saturday, to this email id rizwanag429@gmail.com

    ReplyDelete
  8. please can you send full code of taj mahal to my gmail jetgondapriyanka@gmail.com its arjent n ppt also


    ReplyDelete
  9. evn i need full code for taj mahal plzz send me on
    veereshsajjan18@gmail.com

    ReplyDelete
  10. any one help me to send a code for triangle my email address is
    axadkhan90@gmail.com

    ReplyDelete
  11. i submit the project tuesday so plz snd me source code of triangle.i shall be very thank ful.rajeev sir can u help me my email address is
    axadkhan90@gmail.com

    ReplyDelete
  12. Rajeev sir please snd me the code of flag
    my email id is axadkhan 90@gmail.com
    i shll submit the project tomarrow please help

    ReplyDelete
  13. Mr.Rajiv sir, please do send me. vikilingam@gmail.com

    ReplyDelete
  14. Mr.Rajiv sir, please do send me. vikilingam@gmail.com

    ReplyDelete
  15. Hello. Can you send me the full code for this Taj Mahal. Thank you. sarahathirah_91@yahoo.com

    ReplyDelete
  16. Hi sir can you send me full code for Taj Mahal plz my mail id is ranirathid870@gmail.com

    ReplyDelete
  17. plz send me full code l.uvy@hotmail.com im need nassesory

    ReplyDelete
  18. plz send me full code l.uvy@hotmail.com im need nassesory

    ReplyDelete
  19. pls send me full code of taj mahal... i need to submit the project tomorrow... send to kusumanmurthy@gmail.com

    ReplyDelete
  20. Plz sir can u send me a code for movement of boat using opengl

    ReplyDelete
  21. Or else full code of taj mahal ...i need it urgent sir plz ....send to sushmitha.kulal121@gmail.com

    ReplyDelete

Leave Your comments