## Wednesday, April 18, 2012

### Build Taj Mahal mini projects in OpenGL, Computer Graphics

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();

//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();

//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();

 Project Docs : Source Code \$4.00 USD

1. sir i need the updation of the project memory blocks sir....the updations are
1) inspite of geometrical obejcts i want to add numbers.
2) While displaying the score i want the time also to be displayed..(How much time we took to solve that puzzel)

2. hi nice wrk dear, cn u plz email me d full source code of dis tajmahal program for my mini project...

3. You can get the Taj Project from this blog, but you can make it your own as structure has been given with code. All you have to do is to post some display and keyboard, mouse interactions functions.

Subscribe to email news letter to get the updates as soon it will be on the board.

1. can you tell when it will be avialabel to download the code

4. awesome please send me code and all files of it

5. source code is mentioned here but there is need to add up some other functions so, get the code and work out in display your self...............

6. Rajeev sir,could you please send me the complete source code of this project...please do the needful

7.  Since almost all codes are there, u can develop ur self if problem persist have a comment here

8. sir plz send me complete code and files of it................
shilpa13.shree05@gmail:disqus .com

9. plz gv us source code

10.  code  has been sent 2 u

11. can u pls post complete code of tajmahal

12. can i plsss get complete source code for tis  program.....

13. can u pls post complete code of tajmahal

14.  the whole projects is here , you just need to code the main function and a display function that's it!

15. can u plz put put the entire code?

16.  already said just put main function and run it.........

17. can i get some new topics of cg project

18. Plz send full code of taj mahal

19. open gl means what that is one language??
can u give me full code

20. as i said b4 everthing is here u just need to call main function nothing else.....

21. opengl is platform for coding the graphics and it can be implemented on c, c++ as well as java. you can see it on the apple's products like of iphone. also counter striker is made from this.

22. pls gv d main function.....

23. as usual add the things that u add in normal programs that's it

24. Plz send full code of taj mahal

25. can u plzzz send me the source code for rendering "RAVAN with FIRE" as output in opengl...to ma email...i.i...."harika.87p@gmail.com

26. pls send the source code

27. send me complete source code of tajmahal

28. hai iam ayeshu can u send complete project code of taj mahal for my mini project.i need it.please.alon with main function.i will be waiting.

29. rajeev sir,can u give me a 3d project,fo me.idont wich project i select.so please help me.

30. sir,iwant a 3d project in opengl please provide me with tat type of project,i selected taj mahal but it is not in 3d.please help.iam waiting.please send project to my mail.

31. sir can u plz send me taj mahal's coding to my mail

kalaiselvi5mjkpr5@gmail.com

32. praveenchaudhary3@gmail.com Please send the code

33. hello Rajeev Kumar Singh,

can u send me complete code of this mini project with lighting effects....

34. can u plz mail me the complete project at sheikh.abm@gmail.com

35. can we do this project in visualstuido2005 version...?

36. sir can u please send me the entire code

nemish.kamath@gmail.com
thank you

37. sir can u please mail me the source code

pavan_sudhindra@ymail.com

thank you

39. sir plzz mail me full code of taj mahal ..please at ripun0145@gmail.com

40. sent u...........

41. sir..,Can you please send me complete code ....

surbhi.09.c@gmail.com

42. hello sir,hope you r seeing this text..plz send the main function of this code sir...i tried it,bt itz nt working ...so plz i request u to mail at zeba14rocks@gmail.com

43. can u send this project plz bro faisal.ahmedbcse@gmail.com

44. pls send dis taj mahal project to my mail arpithab92@gmail.com

45. sir can u send me project topic nd coding to my mail arpithab92@gmail.com

46. cn u plz email me d full source code of dis tajmahal program for my mini project...

47. Please send the complete source code to anjithaalila@gmail.com
Plz.....plz..sir