Graphics 4
Graphics 4
Graphics 4
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:
SANDEEP SAINI
Evaluator’s comments:
________________________________________________________________
Part A
Sutherland hodgeman
#include <dos.h>
#include <graphics.h>
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
int cirrad1=0,cirrad2;
void detectmouse ( )
in.x.ax = 0;
int86 (0X33,&in,&out);
if (out.x.ax == 0)
else
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 ( )
cin>>cirrad1;
cin>>cirrad2;
clrscr( );
detectmouse ( );
showmousetext ( );
draw ( );
hidemouse ( );
getch ( );
return 0;
Part B
Z Buffer Algorithm
- Otherwise: