Sponsored Links


Results 1 to 2 of 2

Thread: CS602 Computer Graphics Assignment No. 01 Solution and Discussion Fall 2014

  1. #1
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578

    CS602 Computer Graphics Assignment No. 01 Solution and Discussion Fall 2014

    Sponsored Links1




    CS602 Computer Graphics Assignment No. 01 Solution and Discussion Fall 2014

    Objective

    The objective of this assignment is to;

    Learn and practice basic concepts of computer graphics using Dev-C++. (you can download Dev-C++ setup from LMS)
    Learn to draw text, rectangle and circles using graphics library functions.
    Assignment



    In this assignment, you are provided with a small startup code attached with this assignment in folder “StartupCode”. Your job is to slightly modify this code as desired in this assignment.

    First, you need to understand the working of the given code and execute it in Dev-C++. This program essentially draws some text on screen with a rectangle and two circles labeled as “Earth” and “Moon” and a large circle represents the orbit of Moon as shown in following screenshot.



    Initially, you need to open Assigment1.dev project file in Dev-C++. After successful compilation and execution, you will see the output. You will notice that small circle representing the Moon is blinking. The blinking effect is introduced just by simple continuous drawing this circle in WHITE and BLACK colors with some delay in between. When circle is drawn in WHITE color, it appears on the screen. After some delay, we draw the same circle in BLACK color which makes the circle disappear because our background color is also black. Delay of 100ms is introduced by using delay() function.

    Your Task

    Your task is to slightly modify this code in order to introduce motion effect to the Moon as shown in “Earth_Moon.exe”. This simply requires only few lines of code to modify the x and y coordinates of the Moon. You shall add your code in the areas indicated with comments “Add your code here to modify coordinates of Moon”.

    Hint: You have to use your mathematical skills in order to calculate the coordinates of Moon along the orbit.

    Screenshot of the desired output:
    cs602.jpg

    Sponsored Links

    Your Task

    Your task is to slightly modify this code in order to introduce motion effect to the Moon as shown in “Earth_Moon.exe”. This simply requires only few lines of code to modify the x and y coordinates of the Moon. You shall add your code in the areas indicated with comments “Add your code here to modify coordinates of Moon”.

    Hint: You have to use your mathematical skills in order to calculate the coordinates of Moon along the orbit.

    Screenshot of the desired output:

    cs6021.jpg

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Posts
    323
    HINT:-
    for example:
    if P(x,y) is the current pixel point then if we increment the value of x then pixcel will move towards right and when we decrement the value of y then the pixcel will move towards below and when we increment the valyue of x by 1 and along it decrement the value of y by 1 then the pixcel will move towards right and below...........
    good luck.....



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CS602 Computer Graphics Assignment No.2 Solution Spring Semester 2013
    By Vuhelper in forum Assignments & Solutions
    Replies: 0
    Last Post: 05-17-2013, 05:22 PM
  2. Replies: 0
    Last Post: 04-19-2013, 10:38 PM
  3. Replies: 0
    Last Post: 11-26-2012, 04:20 PM
  4. Replies: 0
    Last Post: 11-21-2012, 06:16 PM
  5. Replies: 6
    Last Post: 11-24-2010, 12:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft