SlideShare a Scribd company logo
1 of 4
Download to read offline
Experiment no. – 3.2
Student Name: Krishna Kumar UID: 19BCS2605
Branch: CSE - 11 Section/Group : ‘C’
Semester: 5th
Date of Performance: 09 Nov 2021
Subject Name: Computer Graphics Lab Subject Code: CSP - 305
1. Aim/Overview of the practical: To display the result of window to viewport transformation.
2. Task to be done: To display the result of window to viewport transformation.
3. Algorithm :
Step1: Start
Step2: Taking the window port and view port co-ordinate form the user
Step3: and also taking two point of line form user
Step4: then calculating scalling factor by using formula
sx = (float)(x_vmax - x_vmin) / (x_wmax - x_wmin);
sy = (float)(y_vmax - y_vmin) / (y_wmax - y_wmin);
Step5: then calculating view point of line by using formula
x1_v = x_vmin + (float)((x1_w - x_wmin) * sx);
y1_v = y_vmin + (float)((y1_w - y_wmin) * sy);
x2_v = x_vmin + (float)((x2_w - x_wmin) * sx);
y2_v = y_vmin + (float)((y2_w - y_wmin) * sy);
Step6: then displaying the result of window port to view port transformation.
Step6: End
4. Programming Code: for to display the result of window to viewport transformation
#include <iostream>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
using namespace std;
void WindowtoViewport(int x1_w, int y1_w,int x2_w, int y2_w, int x_wmax,
int y_wmax, int x_wmin, int y_wmin,
int x_vmax, int y_vmax, int x_vmin,
int y_vmin)
{
int x1_v, y1_v ,x2_v, y2_v;
float sx, sy;
sx = (float)(x_vmax - x_vmin) / (x_wmax - x_wmin);
sy = (float)(y_vmax - y_vmin) / (y_wmax - y_wmin);
x1_v = x_vmin + (float)((x1_w - x_wmin) * sx);
y1_v = y_vmin + (float)((y1_w - y_wmin) * sy);
x2_v = x_vmin + (float)((x2_w - x_wmin) * sx);
y2_v = y_vmin + (float)((y2_w - y_wmin) * sy);
cout<<endl;
cout<< "The point on viewport: ("<<x1_v <<","<< y1_v<<" "<<" to "<<"
"<<x2_v <<","<< y2_v<<")" ;
setcolor(YELLOW);
line(x1_v,y1_v,x2_v,y2_v);
}
int main()
{
int gd=DETECT, gm; int i;
initgraph (&gd,&gm,"c:tcbgi");
int x_wmax , y_wmax , x_wmin , y_wmin ;
cout<<" Enter the window port x_wmax and y_wmax : ";
cin >>x_wmax>>y_wmax;
cout<<" Enter the window port x_wmin and y_wmin : ";
cin>>x_wmin>>y_wmin;
setcolor(WHITE);
outtextxy(x_wmin,y_wmin-20,"Window Port");
rectangle( x_wmin, y_wmin,x_wmax, y_wmax);
int x_vmax , y_vmax , x_vmin , y_vmin ;
cout<<" Enter the view port x_vmax and y_vmax : ";
cin >>x_vmax>>y_vmax;
cout<<" Enter the view port x_vmin and y_vmin : ";
cin>>x_vmin>>y_vmin;
setcolor(GREEN);
outtextxy(x_vmin,y_vmin-20,"View Port");
rectangle( x_vmin,y_vmin,x_vmax, y_vmax);
int x1_w , y1_w ,x2_w , y2_w ;
cout<<"Enter the first point x1_w and y1_w of line : ";
cin>>x1_w>>y1_w;
cout<<"Enter the second point x2_w and y2_w of line : ";
cin>>x2_w>>y2_w;
setcolor(RED);
line(x1_w, y1_w,x2_w, y2_w );
WindowtoViewport(x1_w, y1_w,x2_w, y2_w ,x_wmax, y_wmax, x_wmin,
y_wmin, x_vmax, y_vmax,x_vmin,y_vmin);
getch();
closegraph();
}
5. Output: for to display the result of window to viewport transformation
6. Learning outcomes (What I have learnt):
1. I have gathered detail knowledge about how to display the result of window to viewport
transformation
2. I have learn how to draw the result of window to viewport transformation.
3. I get to know about proper logic & algorithm in computation of the result of window
to viewport transformation
7. Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):
Sr. No. Parameters Marks Obtained Maximum Marks
1.
2.
3.

More Related Content

Similar to 19BCS2605_Krishna_Kumar_Computer_Graphics_Exp_3.2.pdf

Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Patrick Bashizi
 
Deepak Soni ,BCA Third Year
Deepak Soni ,BCA Third YearDeepak Soni ,BCA Third Year
Deepak Soni ,BCA Third YearDezyneecole
 
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingIstanbul Tech Talks
 
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018Codemotion
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Syed Umair
 
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docxVersion1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docxtienboileau
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd marchRajeev Sharan
 
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)Ontico
 
MVI - Managing State The Kotlin Way
MVI - Managing State The Kotlin WayMVI - Managing State The Kotlin Way
MVI - Managing State The Kotlin WayZeyad Gasser
 
Computer science project
Computer science projectComputer science project
Computer science projectSandeep Yadav
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Takao Wada
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++NUST Stuff
 
Keeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in DepthKeeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in DepthGeoffrey Goetz
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfcontact32
 

Similar to 19BCS2605_Krishna_Kumar_Computer_Graphics_Exp_3.2.pdf (20)

Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile
 
Deepak Soni ,BCA Third Year
Deepak Soni ,BCA Third YearDeepak Soni ,BCA Third Year
Deepak Soni ,BCA Third Year
 
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent ProgrammingITT 2014 - Chris Eidhof - Practical Concurrent Programming
ITT 2014 - Chris Eidhof - Practical Concurrent Programming
 
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
Pablo Magaz | ECMAScript 2018 y más allá | Codemotion Madrid 2018
 
12
1212
12
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
 
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docxVersion1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
Version1.0 StartHTML000000232 EndHTML000065057 StartFragment0000.docx
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
ApplicationCoordinator для навигации между экранами / Павел Гуров (Avito)
 
Closures
ClosuresClosures
Closures
 
MVI - Managing State The Kotlin Way
MVI - Managing State The Kotlin WayMVI - Managing State The Kotlin Way
MVI - Managing State The Kotlin Way
 
Computer science project
Computer science projectComputer science project
Computer science project
 
oop Lecture 4
oop Lecture 4oop Lecture 4
oop Lecture 4
 
C++
C++C++
C++
 
C++ TUTORIAL 9
C++ TUTORIAL 9C++ TUTORIAL 9
C++ TUTORIAL 9
 
Games 3 dl4-example
Games 3 dl4-exampleGames 3 dl4-example
Games 3 dl4-example
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++
 
Keeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in DepthKeeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in Depth
 
include ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdfinclude ltiostreamgt include ltstringgt include .pdf
include ltiostreamgt include ltstringgt include .pdf
 

Recently uploaded

Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 

Recently uploaded (20)

Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 

19BCS2605_Krishna_Kumar_Computer_Graphics_Exp_3.2.pdf

  • 1. Experiment no. – 3.2 Student Name: Krishna Kumar UID: 19BCS2605 Branch: CSE - 11 Section/Group : ‘C’ Semester: 5th Date of Performance: 09 Nov 2021 Subject Name: Computer Graphics Lab Subject Code: CSP - 305 1. Aim/Overview of the practical: To display the result of window to viewport transformation. 2. Task to be done: To display the result of window to viewport transformation. 3. Algorithm : Step1: Start Step2: Taking the window port and view port co-ordinate form the user Step3: and also taking two point of line form user Step4: then calculating scalling factor by using formula sx = (float)(x_vmax - x_vmin) / (x_wmax - x_wmin); sy = (float)(y_vmax - y_vmin) / (y_wmax - y_wmin); Step5: then calculating view point of line by using formula x1_v = x_vmin + (float)((x1_w - x_wmin) * sx); y1_v = y_vmin + (float)((y1_w - y_wmin) * sy); x2_v = x_vmin + (float)((x2_w - x_wmin) * sx); y2_v = y_vmin + (float)((y2_w - y_wmin) * sy); Step6: then displaying the result of window port to view port transformation. Step6: End
  • 2. 4. Programming Code: for to display the result of window to viewport transformation #include <iostream> #include<conio.h> #include<graphics.h> #include<dos.h> using namespace std; void WindowtoViewport(int x1_w, int y1_w,int x2_w, int y2_w, int x_wmax, int y_wmax, int x_wmin, int y_wmin, int x_vmax, int y_vmax, int x_vmin, int y_vmin) { int x1_v, y1_v ,x2_v, y2_v; float sx, sy; sx = (float)(x_vmax - x_vmin) / (x_wmax - x_wmin); sy = (float)(y_vmax - y_vmin) / (y_wmax - y_wmin); x1_v = x_vmin + (float)((x1_w - x_wmin) * sx); y1_v = y_vmin + (float)((y1_w - y_wmin) * sy); x2_v = x_vmin + (float)((x2_w - x_wmin) * sx); y2_v = y_vmin + (float)((y2_w - y_wmin) * sy); cout<<endl; cout<< "The point on viewport: ("<<x1_v <<","<< y1_v<<" "<<" to "<<" "<<x2_v <<","<< y2_v<<")" ; setcolor(YELLOW); line(x1_v,y1_v,x2_v,y2_v); } int main() { int gd=DETECT, gm; int i; initgraph (&gd,&gm,"c:tcbgi"); int x_wmax , y_wmax , x_wmin , y_wmin ;
  • 3. cout<<" Enter the window port x_wmax and y_wmax : "; cin >>x_wmax>>y_wmax; cout<<" Enter the window port x_wmin and y_wmin : "; cin>>x_wmin>>y_wmin; setcolor(WHITE); outtextxy(x_wmin,y_wmin-20,"Window Port"); rectangle( x_wmin, y_wmin,x_wmax, y_wmax); int x_vmax , y_vmax , x_vmin , y_vmin ; cout<<" Enter the view port x_vmax and y_vmax : "; cin >>x_vmax>>y_vmax; cout<<" Enter the view port x_vmin and y_vmin : "; cin>>x_vmin>>y_vmin; setcolor(GREEN); outtextxy(x_vmin,y_vmin-20,"View Port"); rectangle( x_vmin,y_vmin,x_vmax, y_vmax); int x1_w , y1_w ,x2_w , y2_w ; cout<<"Enter the first point x1_w and y1_w of line : "; cin>>x1_w>>y1_w; cout<<"Enter the second point x2_w and y2_w of line : "; cin>>x2_w>>y2_w; setcolor(RED); line(x1_w, y1_w,x2_w, y2_w ); WindowtoViewport(x1_w, y1_w,x2_w, y2_w ,x_wmax, y_wmax, x_wmin, y_wmin, x_vmax, y_vmax,x_vmin,y_vmin); getch(); closegraph(); }
  • 4. 5. Output: for to display the result of window to viewport transformation 6. Learning outcomes (What I have learnt): 1. I have gathered detail knowledge about how to display the result of window to viewport transformation 2. I have learn how to draw the result of window to viewport transformation. 3. I get to know about proper logic & algorithm in computation of the result of window to viewport transformation 7. Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty): Sr. No. Parameters Marks Obtained Maximum Marks 1. 2. 3.