<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS602 Assignment 2 Solution and Discussion Spring 2020]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/684/cs602-assignment-2-solution-and-discussion">CS602 Assignment 2 Solution and Discussion</a></p>
<p dir="auto">Assignment No. 02<br />
Semester: Spring 2020<br />
CS602: Computer Graphics<br />
Total Marks: 20</p>
<p dir="auto">Due Date: 15 June 2020</p>
<p dir="auto">Objective<br />
The objective of this assignment is to;<br />
	Learn and practice basic concepts of computer graphics like pixels, lines, text etc using Dev-C++. (You can download Dev-C++ setup from LMS)<br />
	Learn to draw rigid bodies by using graphics library functions.<br />
	Learn the concepts of filled area primitives.<br />
	Learn the basic transformations with fundamental matrix operations.<br />
Instructions:<br />
You have to do the following steps first in order to perform the task.</p>
<ol>
<li>Install Dev-C++ from your LMS.</li>
<li>Read out the file “Add graphics in Dev cpp” thoroughly and follow the instructions in the file properly provided to you on your LMS.<br />
Please read the following instructions carefully before submitting assignment:</li>
<li>You should consult the recommended books, PowerPoint slides , Handouts and video lectures to clarify your concepts.</li>
<li>You can take any help from your provided labs.</li>
<li>It should be clear that your assignment will not get any credit if:<br />
•	The assignment is submitted after due date.<br />
•	The assignment is copied from Internet or from any other student.<br />
•	The submitted assignment does not open or file is corrupt.<br />
Submission<br />
You are required to submit your solution through LMS in zip format containing following files.<br />
	Your Project in zipped form containing both .cpp and .exe file.</li>
</ol>
<p dir="auto">The word document (.doc/docx) or any other file format containing code will not be considered.<br />
If the code files are missing in zip folder, your assignment will be awarded as zero.</p>
<p dir="auto">Note: No assignment will be accepted after the due date through email in any case (load shedding, server down, internet malfunctioning etc.).<br />
It is recommended to upload solution file at least two days before its closing date.<br />
For any query about the assignment, contact at <a href="mailto:cs602@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">cs602@vu.edu.pk</a></p>
<p dir="auto">TASK                                                                                                                                                   Marks=20<br />
This task is based on the concepts of basic transformations like translation, scaling and shearing (along x direction) of a rigid body. For this purpose, you must implement the following:</p>
<ol>
<li>
<p dir="auto">You must make the pentagon having five corners as shown in figure. Mark this picture as ‘Original’.<br />
<img src="https://i.imgur.com/zZKLoTN.png" alt="402e6e51-edfa-4c80-8515-9b8ccf569f68-image.png" class=" img-fluid img-markdown" /></p>
</li>
<li>
<p dir="auto">Now apply shearing along x direction with shx=4 to the original pentagon. Mark the picture as ‘Sheared along x-axis’. (Your results of shearing could be different than the picture shown as per pixels taken)<br />
<img src="https://i.imgur.com/kZXMY0Q.png" alt="ed0303f7-9635-4999-ac85-abcff2aa2442-image.png" class=" img-fluid img-markdown" /></p>
</li>
<li>
<p dir="auto">Now scale the original pentagon by sx=2 and sy=3 and display it on the screen.<br />
<img src="https://i.imgur.com/dPNLkDT.png" alt="8ea569cc-012e-489e-8f17-4c4a95dd7272-image.png" class=" img-fluid img-markdown" /></p>
</li>
<li>
<p dir="auto">Translate the original picture somewhere on screen. Mark it as “Translated”.<br />
<img src="https://i.imgur.com/AZTALDi.png" alt="bebb5b19-c607-41a6-a750-fb1a8527c4ca-image.png" class=" img-fluid img-markdown" /></p>
</li>
</ol>
<p dir="auto">Write a code in c++ to implement above functions. It will be a good programming practice that you implement it by creating pentagon class.</p>
]]></description><link>https://community.secnto.com//topic/1908/cs602-assignment-2-solution-and-discussion-spring-2020</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 00:55:36 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/1908.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 13 Jun 2020 15:36:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS602 Assignment 2 Solution and Discussion Spring 2020 on Mon, 15 Jun 2020 10:13:31 GMT]]></title><description><![CDATA[<p dir="auto"><a href="/assets/uploads/files/1592216006370-graphics-library-for-64-bit-dev-cpp.rar">Graphics library for 64 bit Dev CPP.rar</a></p>
]]></description><link>https://community.secnto.com//post/5393</link><guid isPermaLink="true">https://community.secnto.com//post/5393</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Mon, 15 Jun 2020 10:13:31 GMT</pubDate></item><item><title><![CDATA[Reply to CS602 Assignment 2 Solution and Discussion Spring 2020 on Mon, 15 Jun 2020 10:23:27 GMT]]></title><description><![CDATA[<pre><code>#include&lt;stdio.h&gt; 
#include&lt;conio.h&gt; 
#include&lt;graphics.h&gt;
#include&lt;math.h&gt; 
#include&lt;iostream&gt; 
using namespace std;	


int main()
{
	int gd, gm=DETECT;
	initgraph(&amp;gd, &amp;gm, "");
	
	settextstyle(8,0,1);
	outtextxy(60,5,"CS602 Assignment No. 2 Solution by VU ACADEMY");
	outtextxy(10,35,"1) Original");
	setfillstyle(XHATCH_FILL, GREEN); 
	int arr[] = {50, 90,   80,70,   110, 90,   110, 120,   50, 120,   50,90};
	fillpoly(6, arr); 
	
	
	// x = x+4y
	outtextxy(250,35,"2) Sheared Along X Axis");
	setfillstyle(XHATCH_FILL, GREEN); 
	//int arr2[] = {200, 70, 230,50, 260, 70, 260, 100, 200, 100, 200,70};
	int arr2[] = {330, 90,   280,70,  390, 90,  510, 120, 450, 120, 330,90};
	fillpoly(6, arr2); 
	
	
	// x = 2x
	// y = 2y
	outtextxy(10,200,"3) Scaled");
	setfillstyle(XHATCH_FILL, GREEN); 
	//int arr3[] = {50, 300,    80,280,   110,300,    110, 330,   50, 330,   50,300};
	int arr3[] = {50, 300,    110,240,   170,300,    170, 390,   50, 390,   50,300};
	fillpoly(6, arr3); 


	outtextxy(250,200,"1) Translated");
	setfillstyle(XHATCH_FILL, GREEN); 
	int arr4[] = {300, 300,   330,280,   360, 300,   360, 330,   300, 330,   300,300};
	fillpoly(6, arr4); 
	
	getch();
	closegraph();
	return 0;
}
</code></pre>
]]></description><link>https://community.secnto.com//post/5328</link><guid isPermaLink="true">https://community.secnto.com//post/5328</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Mon, 15 Jun 2020 10:23:27 GMT</pubDate></item></channel></rss>