Professional Documents
Culture Documents
Declaration:
I declare that this assignment is my individual work. I have not
copied from any other student’s work or from any other source
except where due acknowledgment is made explicitly in the
text, nor has any part been written for me by another person.
Student’s Signature:
NITI MALHOTRA
Evaluator’s comments:
________________________________________________________________
_____
Part A
Answer:-
Answer:-
Answer:-
#include <dos.h>
#include <graphics.h>
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
union REGS in, out;
int cirrad1=0,cirrad2;
void detectmouse ()
{
in.x.ax = 0;
int86 (0X33,&in,&out);
if (out.x.ax == 0)
printf ("\nMouse Fail To Initialize");
else
printf ("\nMouse Succesfully Initialize");
}
void showmousetext ()
{
in.x.ax = 1;
int86 (0X33,&in,&out);
}
void showmousegraphics ()
{
in.x.ax = 1;
int86 (0X33,&in,&out);
getch ();
closegraph ();
}
void hidemouse ()
{
in.x.ax = 2;
int86 (0X33,&in,&out);
}
void draw ()
{ while(out.x.bx!=2)
{
int x,y,x1,y1;
in.x.ax = 3;
int86 (0X33,&in,&out);
cleardevice();
if (out.x.bx == 1)
{
x = out.x.cx;
y = out.x.dx;
setcolor(10);
circle(x,y,cirrad1);
}
if (out.x.bx == 1)
{
x = out.x.cx;
y = out.x.dx;
setcolor(10);
circle(x,y,cirrad2);
}
if (out.x.bx == 1)
{
x = out.x.cx;
y = out.x.dx;
//setcolor(10);
// circle(x,y,cirrad2);
}
if (out.x.bx == 1)
{
x1 = out.x.cx;
y1 = out.x.dx;
}
line(x,y,x+34,y+23);
line(x,y,x-90,y-0);
delay (10);
}
getch();
}
int main ()
{
cout<<"There will be 2 circle followes by a rectangle and
then a line";
cout<<"\nEnter the radius of the two circle ";
cin>>cirrad1;
cin>>cirrad2;
clrscr();
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
detectmouse ();
showmousetext ();
draw ();
hidemouse ();
getch ();
return 0;
}
Part B
Answer:-
1. Initialization:-
2. Y-scan loop:-
3. X-scan loop:-
Answer:-
The need of removing what is not visible has been and always
will be extremely high in the gaming industry, even though
graphic cards evolve at gigantic rates and things that were true
a couple years ago are not even remotely true these days.
When a game is created a goal frame rate[*] is set.
Object-space techniques
Applied before vertices are mapped to pixels
Image-space techniques
Applied after vertices have been rasterized
Z-buffering: -
Ray tracing: -
Painter's algorithm: -
Answer:-