Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved

    CS602 Assignment 2 Solution and Discussion Spring 2020

    CS602 - Computer Graphics
    cs602 assignment 2 solution discussion spring 2020
    1
    3
    179
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zaasmi
      zaasmi Cyberian's Gold last edited by

      Re: CS602 Assignment 2 Solution and Discussion

      Assignment No. 02
      Semester: Spring 2020
      CS602: Computer Graphics
      Total Marks: 20

      Due Date: 15 June 2020

      Objective
      The objective of this assignment is to;
       Learn and practice basic concepts of computer graphics like pixels, lines, text etc using Dev-C++. (You can download Dev-C++ setup from LMS)
       Learn to draw rigid bodies by using graphics library functions.
       Learn the concepts of filled area primitives.
       Learn the basic transformations with fundamental matrix operations.
      Instructions:
      You have to do the following steps first in order to perform the task.

      1. Install Dev-C++ from your LMS.
      2. Read out the file “Add graphics in Dev cpp” thoroughly and follow the instructions in the file properly provided to you on your LMS.
        Please read the following instructions carefully before submitting assignment:
      3. You should consult the recommended books, PowerPoint slides , Handouts and video lectures to clarify your concepts.
      4. You can take any help from your provided labs.
      5. It should be clear that your assignment will not get any credit if:
        • The assignment is submitted after due date.
        • The assignment is copied from Internet or from any other student.
        • The submitted assignment does not open or file is corrupt.
        Submission
        You are required to submit your solution through LMS in zip format containing following files.
         Your Project in zipped form containing both .cpp and .exe file.

      The word document (.doc/docx) or any other file format containing code will not be considered.
      If the code files are missing in zip folder, your assignment will be awarded as zero.

      Note: No assignment will be accepted after the due date through email in any case (load shedding, server down, internet malfunctioning etc.).
      It is recommended to upload solution file at least two days before its closing date.
      For any query about the assignment, contact at [email protected]

      TASK Marks=20
      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:

      1. You must make the pentagon having five corners as shown in figure. Mark this picture as ‘Original’.
        402e6e51-edfa-4c80-8515-9b8ccf569f68-image.png

      2. 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)
        ed0303f7-9635-4999-ac85-abcff2aa2442-image.png

      3. Now scale the original pentagon by sx=2 and sy=3 and display it on the screen.
        8ea569cc-012e-489e-8f17-4c4a95dd7272-image.png

      4. Translate the original picture somewhere on screen. Mark it as “Translated”.
        bebb5b19-c607-41a6-a750-fb1a8527c4ca-image.png

      Write a code in c++ to implement above functions. It will be a good programming practice that you implement it by creating pentagon class.

      Discussion is right way to get Solution of the every assignment, Quiz and GDB.
      We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
      Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
      NOTE: Don't copy or replicating idea solutions.
      Quiz Copy Solution
      Mid and Final Past Papers
      Live Chat

      1 Reply Last reply Reply Quote 0
      • zaasmi
        zaasmi Cyberian's Gold last edited by

        Graphics library for 64 bit Dev CPP.rar

        Discussion is right way to get Solution of the every assignment, Quiz and GDB.
        We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
        Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
        NOTE: Don't copy or replicating idea solutions.
        Quiz Copy Solution
        Mid and Final Past Papers
        Live Chat

        1 Reply Last reply Reply Quote 0
        • zaasmi
          zaasmi Cyberian's Gold last edited by zaasmi

          #include<stdio.h> 
          #include<conio.h> 
          #include<graphics.h>
          #include<math.h> 
          #include<iostream> 
          using namespace std;	
          
          
          int main()
          {
          	int gd, gm=DETECT;
          	initgraph(&gd, &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;
          }
          

          Discussion is right way to get Solution of the every assignment, Quiz and GDB.
          We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
          Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
          NOTE: Don't copy or replicating idea solutions.
          Quiz Copy Solution
          Mid and Final Past Papers
          Live Chat

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Insaf Sehat Card Live Cricket Streaming

          100% Off on Your FEE Join US! Ask Me How?

          Quiz 100% Result If you want to know how you can join us and get 100% Discount on your FEE ask Cyberian in Chat Room!
          Quiz 100% Result Quiz 100% Result
          solution1255 discussion1206 fall 2019813 assignment 1433 assignment 2297 spring 2020265 gdb 1248 assignment 382 crw10174 spring 201955
          | |
          Copyright © 2021 Cyberian Inc. Pakistan | Contributors
          Live Chat