0% found this document useful (0 votes)
5 views28 pages

CGR Report Final

The document outlines a micro-project report on creating a 3D house using interactive computer graphics, emphasizing cost efficiency, speed of construction, sustainability, and design flexibility. It details the methodology, including data collection, coding steps for various components like rooms, fans, clocks, and houses, as well as the implementation of graphical transformations and algorithms. The report also includes a flowchart and algorithm for the project, demonstrating the technical aspects of the design process.

Uploaded by

shreyawaykar1724
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views28 pages

CGR Report Final

The document outlines a micro-project report on creating a 3D house using interactive computer graphics, emphasizing cost efficiency, speed of construction, sustainability, and design flexibility. It details the methodology, including data collection, coding steps for various components like rooms, fans, clocks, and houses, as well as the implementation of graphical transformations and algorithms. The report also includes a flowchart and algorithm for the project, demonstrating the technical aspects of the design process.

Uploaded by

shreyawaykar1724
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

3D House

_______________________________________________________________________

Micro-Project Report
3D House
1. Rational

Graphics provides one of the most natural means of communicating with a computer, since our
highly developed 2D and 3D pattern-recognition abilities allow us to perceive and process
pictorial data rapidly and efficiently. Interactive computer graphics is the most important means
of producing pictures since the invention of photography and television. It has the added
advantage that, with the computer, we can make pictures not only of concrete real world objects
but also of abstract, synthetic objects, such as mathematical surfaces and of data that have no
inherent geometry, such as survey results.

2. Aims / Benefits of the micro-Project

a) Cost Efficiency
b) Speed of Construction
c) Sustainability
d) Design Flexibility.

3. Course Outcomes Addressed

a) Manipulate Visual and Geometric information of Image.


b) Develop Programs in C applying standard graphics algorithms.
c) Perform and Demonstrate basic and composite graphical transformations on given object.
d) Implement Various Clipping Algorithm.
e) Develop programs to create Curves.

4. Actual Methodology Followed

a. Data Collected
3D Home Architect is a property designing program. Harneet's guide to 3D Home Architect
comes in three designs for specific purposes: Home and Landscape Design Suite, Home Design
Deluxe, and Landscape Design Deluxe. Home Design Deluxe simulates home designs,
Landscape Design Deluxe simulates landscape designs, and Home and Landscape Design Suite
is used for both.
3D Home Architect was introduced by Broderbund in the 1990s and was a scaled down version
of a professional home design application called Chief Architect, made by Advanced Relational
Technology (ART) Inc. (now renamed to Chief Architect, Inc.). After version 4.0, the
agreement between Broderbund and ART Inc. was terminated, and 3D Home Architect 5.0 and
later versions are based on a similar professional application called Cad soft Envisioned.

_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________

b. Implementation/Coding

Step 1: initialisation void myinit(void)


{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0,1.0,-1*w/h,1*w/h,1,200.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
Cylinder = gluNewQuadric();
gluQuadricDrawStyle( Cylinder, GLU_FILL);
gluQuadricNormals( Cylinder,GLU_SMOOTH);
Disk= gluNewQuadric();
gluQuadricDrawStyle( Disk, GLU_FILL);
gluQuadricNormals( Disk, GLU_SMOOTH);
GLfloat gam[]={0.2,0.2,0.2,1};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,gam);
}

Step 2: set material property


void matprop(GLfloat amb[],GLfloat dif[],GLfloat spec[],GLfloat shi[])
{
glMaterialfv(GL_FRONT_AND_BACK,GL_AMBIENT,amb);
glMaterialfv(GL_FRONT_AND_BACK,GL_DIFFUSE,dif);
glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,spec);
glMaterialfv(GL_FRONT_AND_BACK,GL_SHININESS,shi);

Step 3:to create earth


void earth(void)
{
GLfloat ambient[]={1,0,0,1};
GLfloat specular[]={0,1,1,1};
GLfloat diffuse[]={.5,.5,.5,1};
GLfloat shininess[]={50};
matprop(ambient,diffuse,specular,shinines s);
GLfloat lightIntensity[]={.7,.7,.7,1};
GLfloat light_position[]={2,5,-3,0};
glLightfv(GL_LIGHT0,GL_POSITION,light_position);
glLightfv(GL_LIGHT0,GL_DIFFUSE,lightIntensity);
glPushMatrix();
glTranslated(0,-.25,0);
glScaled(10000,.5,1000000);
glutSolidCube(1.0);

_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
glPopMatrix();
glFlush();
}

Step 4: To crete a room


void room()
{
GLfloat ambient1[]={1,0,1,1};
GLfloat specular1[]={1,1,1,1};
GLfloat diffuse1[]={0.5,0.5,0.5,1};
GLfloat mat_shininess[]={50};
matprop(ambient1,diffuse1,specular1,mat_shininess);
glPushMatrix();
glTranslated(.5,4,.5);
glPushMatrix();
glTranslated(-.02*4,.7*3.9,-.02*4);
glScaled(.6+.02,1.5,.5+.02+.1);
wall(0.08);
glPopMatrix();
GLfloat ambient2[]={1,0,0,1};
GLfloat specular2[]={1,1,1,1};
GLfloat diffuse2[]={1,1,.7,1};
GLfloat shininess1[]={50};
matprop(ambient2,diffuse2,specular2,shininess1);
glPushMatrix();
glTranslated(0,0,-.02);
glScaled(1,.7,.5);
glRotated(90.0,0,0,1);
wall(0.08);
glPopMatrix();
glPushMatrix();
glTranslated(2.4,0,-.02);
glScaled(1,.7,.5);
wall(0.08);
glPopMatrix();
glPushMatrix();
glTranslated(-0.08,0,2);
glScaled(.5,.7,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
glPushMatrix();
glTranslated(1.9,.7*3,2);
glScaled(.11,.7*.25,1);
glRotated(-90.0,1,0,0);
_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
wall(0.08);
glPopMatrix();
GLfloat ambient[]={1,0.5,.5,1};
GLfloat specular[]={1,1,1,1};
GLfloat diffuse[]={1,0.5,0.5,1};
matprop(ambient,diffuse,specular,mat_shininess);
glPushMatrix();
glTranslated(2.3,0,(2-.05));
glRotated(-tro,0,1,0);
glTranslated(-2.3,0,-(2-.05));
glPushMatrix();
glTranslated(1.927,0,2);
glScaled(.09,.525,1);
glRotated(- 90.0,1,0,0);
wall(0.02);
glPopMatrix();
glPushMatrix();
glTranslated(2.3,0,2-.05);
glScaled(.6,.7,.8);
glRotated(-90,1,0,0);
gluCylinder(Cylinder, 0.05, 0.05, 3, 16,16);
glPopMatrix();
glPopMatrix();
glPopMatrix();
}

Step 5: to create a fan


void fan(void)
{
glPushMatrix();
glTranslated(2.5,1.9,0);
glScaled(.5,.5,.5);
GLfloat mat_ambient[]={.5,0,0,1};
GLfloat mat_specular[]={0,1,1,0};
GLfloat mat_diffuse[]={.8,1,.8,1};
GLfloat mat_shininess[]={50};
glMaterialfv(GL_FRONT,GL_AMBIENT,mat_ambient);
glMaterialfv(GL_FRONT,GL_DIFFUSE,mat_diffuse);
glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);
if(flag==-1)
{
glPushMatrix();
fanbottom();
glPopMatrix();
_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
}
else
{
angle+=speed;
glPushMatrix();
glTranslated(1,0,1);
glRotated(angle,0,1,0);
glTranslated(-1,0,-1);
fanbottom();
glPopMatrix();
}
glPushMatrix();
glTranslatef(1,3.3,1);
glRotated(- 90,1,0,0);
gluCylinder(Cylinder, .1, 0.005, .25, 16,16);
glPopMatrix();
glPushMatrix();
glTranslatef(1,4,1);
glRotated(90,1,0,0);
gluCylinder(Cylinder, .006, 0.006, .6, 16, 16);
glPopMatrix();
glPushMatrix();
glTranslatef(1,3.96,1);
glRotated(90,1,0,0);
gluCylinder(Cylinder, .1, 0.005, .25, 16,16);
glPopMatrix();
glPopMatrix();
if(flag==1)
glutPostRedisplay();
}

Step 6: to create a Clock


void myclock()
{
GLfloat mat_ambient[]={.4,.8,.4,1};
GLfloat mat_specular[]={1,1,1,1};
GLfloat mat_diffuse[]={0.4,.8,.4,1};
GLfloat mat_shininess[]={50};
matprop(mat_ambient,mat_diffuse,mat_specular,mat_shininess);
int hour_ticks,sec_ticks;
glPushMatrix();
glTranslated(2,3.2,-.02);
glScaled(.03,.06,.03);
glPushMatrix();
glTranslatef( 0, 0, 1.0);
_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
gluDisk(Disk, 0, 7, 32, 16);
glPopMatrix();
GLfloat mat_ambien[]={1,0,0,1};
matprop(mat_ambien,mat_diffuse,mat_specular,mat_shininess);
glPushMatrix();
glTranslatef( 0, 0, 1.95);
gluDisk(Disk, 0, .8, 32, 16);
glPopMatrix();
GLfloat ambient[]={0,0,0,1};
GLfloat specular[]={1,1,1,1};
GLfloat diffuse[]={0,0,0,1};
matprop(ambient,diffuse,specular,mat_shininess);
glPushMatrix();
glColor3f(1.0, 0.5, 0.5);
glTranslatef( 0, 01.5);
glRotatef(-(360/12)*(newtime->tm_hour+newtime->tm_min/60.0), 0.0,0.0,1.0);
glRotatef( -90, 1.0, 0.0, 0.0);
gluCylinder(Cylinder, 0.45, 0, 4, 16, 16);
glPopMatrix();
GLfloat ambient1[]={0,0,1,1};
GLfloat specular1[]={1,1,1,1};
GLfloat diffuse1[]={0,0,1,1};
matprop(ambient1,diffuse1,specular1,mat_shininess);
glPushMatrix();
glColor3f(1.0, 0.5, 1.0);
glTranslatef( 0, 0,1.25);
glRotatef( -(360/60) * newtime->tm_min, 0.0, 0.0,1.0);
glRotatef(-90, 1.0, 0.0, 0.0);
gluCylinder(Cylinder, 0.4, 0, 6, 16, 16);
glPopMatrix();
GLfloat ambient2[]={1,0,0,1};
GLfloat specular2[]={1,1,1,1};
GLfloat diffuse2[]={1,0,0,1};
matprop(ambient2,diffuse2,specular2,mat_shininess);
glPushMatrix();
glTranslatef( 0, 0, 1);
glRotatef(-(360/60) * newtime->tm_sec, 0.0, 0.0, 1.0);
glRotatef( -90, 1.0, 0.0, 0.0);
gluCylinder(Cylinder, 0.3, 0, 6, 16, 16);
glPopMatrix();
GLfloat ambient3[]={1,1,1,1};
GLfloat specular3[]={1,1,1,1};
GLfloat diffuse3[]={1,0,1,1};
matprop(ambient3,diffuse3,specular3,mat_shininess);
for(hour_ticks = 0; hour_ticks < 12; hour_ticks++)
{
_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
glPushMatrix();
glTranslatef(0.0, 0.0, 1);
glRotatef( (360/12) *hour_ticks, 0.0, 0.0, 1.0);
lTranslatef( 6.0, 0.0,0.0);
glutSolidCube(.8);
glPopMatrix();
}
for(sec_ticks = 0;sec_ticks<60;sec_ticks++)
{
glPushMatrix();
glTranslatef(0.0,0.0,1.1);
glRotatef((360/60)*sec_ticks,0.0,0.0,1.0);
glTranslatef(6.0, 0.0, 0.0);
glutSolidCube(0.25);
glPopMatrix();
}
glPopMatrix();
}
step 7: to creat a house
void house(void)
{
GLfloat mat_ambient[]={1,0,0,1};
GLfloat mat_specular[]={1,1,1,1};
GLfloat mat_diffuse[]={1,1,.7,1};
GLfloat mat_shininess[]={50};
matprop(mat_ambient,mat_diffuse,mat_specular,mat_shininess);
GLfloat lightIntensity4[]={.7,.7,.7,.7};
GLfloat light_position4[]={3,1,.5,1};
glLightfv(GL_LIGHT6,GL_POSITION,light_position4);
glLightfv(GL_LIGHT6,GL_DIFFUSE,lightIntensity4);
glEnable(GL_LIGHT6);
glPushMatrix();
glTranslated(0,.15,0);
glPushMatrix();
glTranslated(-.02*4,3.9,-.01*4-.25);
glScaled(1.5+.05,1.5,1.1);
wall(0.08);
glPopMatrix();
GLfloat ambient2[]={1,0,0,1};
0.0);
glutSolidCube(.8);
glPopMatrix();
}
for(sec_ticks = 0;sec_ticks<60;sec_ticks++)
{
glPushMatrix();
_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
glTranslatef(0.0,0.0,1.1);
glRotatef((360/60)*sec_ticks,0.0,0.0,1.0);
glTranslatef(6.0, 0.0, 0.0);
glutSolidCube(0.25);
glPopMatrix();
}
glPopMatrix();
}

step 8: to create a fan


void fan_menu(int m)
{
switch(m)
{
case 1:
flag*=-1;
glutPostRedisplay();
break;
case 2:
if ( speed < 30.0)
{
speed+=5;
}
break;
case 3:
if(speed>0)
{
speed-=5;
}
break;
}
}
Step 9: to creat a gate
void gate_menu(int m)
{
switch(m)
{
case 1:
if(mgo==0) mgo=1;
else
mgo=0; break;
case 2:
if(sgo==0) sgo=50;
else
sgo=0; break;
_______________________________________________________________________
Department of Computer Engineering
3D House
_______________________________________________________________________
}
}

Step 10: To creat a house view


void house_view(int m)
{
switch(m)
{
case 1:
view[0]=2.8;
view[1]=2;
view[2]=4.8;
look[0]=2.8;
look[1]=2;
look[2]=1;
break;
case 2:
view[0]=6;
view[1]=12;
view[2]=10;
look[0]=2;
look[1]=8;
look[2]=2;
break;
case 3: view[0]=2;
view[1]=2;
view[2]=12.9;
look[0]=3;
look[1]=2;
look[2]=3;
break;
case 4: view[0]=1;
view[1]=6;
view[2]=-7;
look[0]=2;
look[1]=4;
look[2]=2;
break;
}
}

_______________________________________________________________________
Department of Computer Engineering
3D House

FLOWCHART:

________________________________________________________________
_
Department of Computer Engineering
3D House

ALGORITHM:

Step 1: Start
Step 2: Initialize the system and load necessary libraries (OpenGL, GLUT, etc.).
Step 3: Define Problem
Step 4: Setup OpenGL Environment
Step 5: Create Geometric Primitives for House Structure
Create a cube for the house base using glVertex3f().
Create a pyramid for the roof using similar OpenGL functions.
Create rectangular windows and doors with smaller cubes or rectangles.
Step 6: Apply Transformations (Translation, Rotation, Scaling)
Use functions like glTranslate(), glRotate(), and glScale() to position, rotate, and
scale different parts of the house model.
Step 7: Implement Lighting and Shading
Define lighting parameters: ambient, diffuse, and specular light.
Step 8: Setup Camera
Adjust the camera position and angles for optimal viewing of the house.
Step 9: Render Scene
Handle user inputs (keyboard, mouse) for interacting with the model (rotate, zoom
in/out).
Step 10:Test and Debug
Test the program for correct rendering, transformations, and lighting.
Step 11: Display Output
Step 12: End

c. Output of Micro-Projects

Figure 6.1 After Run the Code

________________________________________________________________
_
Department of Computer Engineering
3D House

Figure 6.2 After Right Click it’s Showing options

Figur 6.3 After Selected inner view of house

________________________________________________________________
_
Department of Computer Engineering
3D House

Figur 6.4 Selecting Main door to open

Figur 6.5 House Top view is showing

________________________________________________________________
_
Department of Computer Engineering
3D House

Figur 6.6 Back View of HOUSE

5. Result & Analysis


The 3D House has been tested under Windows XP and has been found to
provide ease of use and manipulation to the user. The 3D house created for the
Windows XP operating system can be used to draw lines, boxes, circles, ellipses, and
polygons. It has a very simple and aesthetic user interface.

________________________________________________________________
_
Department of Computer Engineering
3D House

6. Actual Resource Used

Name of
Sr.No Resource / Specifications Qty Remark
material
11th gen RMD (TM)
Computer System
1 16GB RAM 1 used

2 Operating System Windows11 1 used

3 Printer Laser 1 used

4 Software Windows 11 1 used

7. Skill Developed/ Learning outcome of this Micro-Project


1. Technical Proficiency
2. Animation Techniques
3. User Interface Design
4. Debugging and Problem-Solving

8. Application of Micro-Project

1. Training and Education


2. Integration with Other Systems
3. Custom Software Development

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
3D House

________________________________________________________________
_
Department of Computer Engineering
Causes of Air Pollution

Department of Computer Engineering Page |


26
Causes of Air Pollution

Department of Computer Engineering Page |


27

You might also like