3D House Mini Project: Dept 0f CSE, SCET Belgaum
3D House Mini Project: Dept 0f CSE, SCET Belgaum
3D House Mini Project: Dept 0f CSE, SCET Belgaum
Chapter 1
1.1 INTRODUCTION
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.
The narrative mode (also known as the mode of narration) is the set of
methods the author of a literary, theatrical, cinematic, or musical story uses to convey the
plot to the audience. Narration, the process of presenting the narrative, occurs because of
the narrative mode. It encompasses several overlapping areas of concern, most
importantly narrative point-of-view, which determines through whose perspective the
story is viewed; narrative voice, which determines the manner through which the story is
communicated to the author to be the same person. However, the narrator may be a fictive
person devised by the author as a stand-alone entity, or even a character. The narrator is
considered participant if an actual character in the story, and nonparticipant if only an
implied character, or a sort of omniscient or semi-omniscient being who does not take
part in the story but only relates it to the audienc
Chapter 2
2. LITERATURE SURVEY
Computer graphics started with the display of data on hardcopy plotters and
cathode ray tube (CRT) screens soon after the introduction of computers.
Computer graphics today largely interactive, the user controls the contents,
structure, and appearance of objects and of displayed images by using input devices, such
as keyboard, mouse, or touch-sensitive panel on the screen. Graphics based user
interfaces allow millions of new users to control simple, low-cost application programs,
such as spreadsheets, word processors, and drawing programs.
In the 1980s, developing software that could function with a wide range of
graphics hardware was a real challenge. By the early 1990s, Silicon Graphics (SGI) was a
leader in 3D graphics for workstations. SGI's competitors (including Sun Microsystems,
Hewlett-Packard and IBM) were also able. In addition, SGI had a large number of
software customers; by changing to the OpenGL API they planned to keep their
customers locked onto SGI (and IBM) hardware for a few years while market support for
OpenGL matured to bring to market 3D hardware, supported by extensions made to the
PHIGS standard. In 1992, SGI led the creation of the OpenGL architectural review board
(OpenGL ARB), the group of companies that would maintain and expand the
OpenGL provides a powerful but primitive set of rendering command, and all
higher-level drawing must be done in terms of these commands. There are several
libraries that allow you to simplify your programming tasks, including the following:
OpenGL Utility Library (GLU) contains several routines that use lower-level
OpenGL commands to perform such tasks as setting up matrices for specific viewing
orientations and projections and rendering surfaces.
To achieve the objective of the project, information related to the light sources is
required with OpenGL we can manipulate the lighting and objects in a scene to create
many different kinds of effects. It explains how to control the lighting in a scene,
discusses the OpenGL conceptual model of lighting, and describes in detail how to set the
numerous illumination parameters to achieve certain effects. This concept is being
obtained from .
The properties of a light source like its material, diffuse, emissive, has to mention
in the project. So to design the light source and the objects, programming guide of an
OpenGL is used.
Chapter 3
X86
X64(WOW)
Mouse Driver
Graphics Driver
C Language
CHAPTER 4
DESIGN
4.1 EXISTING SYSTEM
Existing system for a graphics is the TC++. This system will support only the 2D
graphics. 2D graphics package being designed should be easy to use and understand. It
should provide various options such as free hand drawing, line drawing, polygon
drawing, filled polygons, flood fill, translation, rotation, scaling, clipping etc. Even
though these properties were supported, it was difficult to render 2D graphics cannot be
very difficult to get a 3 Dimensional object. Even the effects like lighting, shading cannot
be provided. So we go for Microsoft Visual Studio software.
Chapter 5
IMPLEMENTATION
5.1
Functions
The glColor3f (float, float, float) :- This function will set the current drawing color
glClear( ):-Takes a single argument that is the bitwise OR of several values indicating
which buffer is to be cleared.
glClearColor ():-Specifies the red, green, blue, and alpha values used by glClear to clear
the color buffers.
Void glutInit (int *argc, char**argv):-Initializes GLUT, the arguments from main are
passed in and can be used by the application.
Void glutInitWindowSize (int width, int height):- Specifies the initial position of the
top-left corner of the window in pixels
Int glutCreateWindow (char *title):-A window on the display. The string title can be
used to label the window. The return value provides references to the window that can be
used when there are multiple windows.
Void glutMouseFunc(void *f(int button, int state, int x, int y):-Register the mouse
callback function f. The callback function returns the button, the state of button after the
event and the position of the mouse relative to the top-left corner of the window.
Void glutDisplayFunc (void (*func) (void)):-Register the display function func that is
executed when the window needs to be redrawn.
glut PostReDisplay ( ) :-which requests that the display callback be executed after the
current callback returns.
Void MouseFunc (void (*func) void)):-This function is invoked when mouse keys are
pressed. This function is used as an alternative to the previous function i.e., it is used to
move the object(car) to right or left in our program by clicking left and right button
respectively.
Void glutMainLoop ()
Cause the program to enter an event-processing loop. It should be the last statement in
main function.
Chapter 6
Chapter 7
7.1 CONCLUSION
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.
We found designing and developing this 3D House as a very interesting and learning
experience. It helped us to learn about computer graphics, design of Graphical User
Interfaces, interface to the user, user interaction handling and screen management. The
graphics editor provides all and more than the features that have been detailed in the
university syllabus.
These are the features that are planned to be supported in the future
* Support for multiple canvases
* Support for pattern filling
* Support for 3d transformations
* Support for transparency of layers
7.3 LIMITATIONS
As with all types of parallel projection, objects drawn with isometric projection do not appear
larger or smaller as they extend closer to or away from the viewer. While advantageous for
architectural drawings where measurements need to be taken directly, the result is a perceived
distortion, as unlike perspective projection, it is not how our eyes or photography normally
work. It also can easily result in situations where depth and altitude are difficult to gauge, as
is shown in the illustration to the right
APPENDIX
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();
//defining new quadric object
Cylinder = gluNewQuadric();
//to set drawing style
gluQuadricDrawStyle( Cylinder,
GLU_FILL);
//to set automatic normals
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,ga
m);
}
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();
}
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();
}
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_shinines
s);
/ Draw hour hand
glPushMatrix();
glColor3f(1.0, 0.5,
0.5); glTranslatef( 0,
0, 1.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_shinines
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();
}
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_shinines
s); GLfloat lightIntensity4[]={.7,.7,.7,.7};
GLfloat light_position4[]={3,1,.5,1};
glLightfv(GL_LIGHT6,GL_POSITION,light_position
4);
glLightfv(GL_LIGHT6,GL_DIFFUSE,lightIntensity4);
glEnable(GL_LIGHT6);
glPushMatrix();
glTranslated(0,.15,0);
//roof
glPushMatrix();
glTranslated(-.02*4,3.9,-.01*4-.25);
glScaled(1.5+.05,1.5,1.1);
wall(0.08);
glPopMatrix();
glTranslated(-.08,0,0);
glScaled(1.5+.02,1,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//room vertical wall
glPushMatrix();
glTranslated(4,0,0);
glScaled(1,1,.5);
glRotated(90.0,0,0,1);
wall(0.08);
glPopMatrix();
//room horizantal wall
glPushMatrix();
glTranslated(4.4,0,2);
glScaled(.4,1,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//wall above the room door
glPushMatrix();
glTranslated(4,3,2);
glScaled(.11,.25,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//left room horizantal wall
glPushMatrix();
glTranslated(0,0,2);
glScaled(.4,1,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPushMatrix();
glTranslated(1.6,0,2.59);
glScaled(1,1,.35);
glRotated(90.0,0,0,1);
wall(0.08);
glPopMatrix();
//wall above main door
glPushMatrix();
glTranslated(-0.02,3,4);
glScaled(.13,.27,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//wall right to the main door
glPushMatrix();
glTranslated(.48,0,4);
glScaled(.68,1,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//wall right to the window
glPushMatrix();
glTranslated(4.8,0,4);
glScaled(.3,1,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//wall below the window
glPushMatrix();
glTranslated(3.2,0,4);
glScaled(.4,.25,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
//wall above the window
glPushMatrix();
glTranslated(3.2,3.03,4);
glScaled(.4,.25,1);
glRotated(-90.0,1,0,0);
wall(0.08);
glPopMatrix();
room();
watertank();
terece();
steps();
window();
fan();
cot(.6,.9,.06,.35,.009);
diningtable();
myclock();
solar();
GLfloat ambient[]={1,0.5,.5,1}; GLfloat
specular[]={1,1,1,1}; GLfloat
diffuse[]={1,.5,.5,1};
matprop(ambient,diffuse,specular,mat_shinines
s); //main door
glPushMatrix();
glTranslated(0,0,4);
glRotated(maino,0,1,0);
glTranslated(0,0,-4);
glPushMatrix();
glTranslated(0,0,4);
glScaled(.12,.75,1);
glRotated(-90.0,1,0,0);
wall(0.04);
glPopMatrix();
glPushMatrix();
glTranslated(0,0,4);
glScaled(.5,1,.2);
glRotated(-90,1,0,0);
gluCylinder(Cylinder, 0.05, 0.05, 3, 16, 16);
glPopMatrix();
glPopMatrix();
glTranslated(4,0,2);
glScaled(.099,.75,1);
glRotated(-90.0,1,0,0);
wall(0.01);
glPopMatrix();
glPushMatrix();
glTranslated(4.01,0,2-.025);
glScaled(.5,1,.6);
glRotated(-90,1,0,0);
gluCylinder(Cylinder, 0.05, 0.05, 3, 16, 16);
glPopMatrix();
glPopMatrix();
glPopMatrix();
glFlush();
}
flag*=-1;
glutPostRedisplay();
break;
case 2:if ( speed < 30.0)
{
speed+=5;
}
break;
case 3:
if (speed>0)
{
speed-=5;
}
break;
}
}
case 1:
if(mgo==0)
mgo=1;
else
mgo=0;
break;
case 2:
if(sgo==0)
sgo=50;
else
sgo=0;
break;
}
}
BIBLIOGRAPHY
th
[1] Edward Angel’s Interactive Computer Graphics Pearson Education 5 Edition
[2] Interactive computer Graphics --A top down approach using open
GL--by Edward Angle
[3] Jackie .L. Neider, Mark Warhol, Tom.R.Davis, "OpenGL Red Book",
Second Revised Edition, 2005.