Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS602 Computer Graphics Assignment No. 01 Solution and Discussion Fall 2014
#1


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:
[ATTACH=CONFIG]24147[/ATTACH]

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:

[ATTACH=CONFIG]24148[/ATTACH]


Attached Files
.jpg   cs602.jpg (Size: 24.07 KB / Downloads: 1,923)
.jpg   cs6021.jpg (Size: 51.26 KB / Downloads: 469)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#2
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.....


Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cs403 Assignment 3 Helping material May 8,2010 viki 1 5,207 04-28-2020, 03:19 PM
Last Post: ClaireBeauc
  cs301 assignment no 3 Solution 20 January 2016 Vuhelper 0 11,093 01-20-2016, 03:32 PM
Last Post: Vuhelper
  CS201 Assignment vo 3 Solution 20th January 2016 Vuhelper 2 2,600 01-20-2016, 03:28 PM
Last Post: Vuhelper
  CS101 Assignment no 3 Solution 20th January 2016 Vuhelper 0 2,284 01-20-2016, 03:25 PM
Last Post: Vuhelper
  SOC101 INTRODUCTION TO SOCIOLOGY assignment no 3 Solution 20 January 2016 Vuhelper 0 1,872 01-20-2016, 03:19 PM
Last Post: Vuhelper
  CS402 Assignment No 4 Solution & Discussion Xpert 0 2,103 08-01-2015, 02:33 AM
Last Post: Xpert
  cs101 Assignment No. 1 Solution 21 may spring 2015 semester Xpert 0 2,912 05-21-2015, 12:41 AM
Last Post: Xpert
  Assignment solution eng 301 due date 20 may 2015 rumesa khan 3 4,537 05-20-2015, 01:34 AM
Last Post: Xpert
  PHY301 Circuit Theory Assignment No. 1 idea Solution spring may 2015 semester Xpert 0 1,563 05-15-2015, 03:52 AM
Last Post: Xpert
  Assignment No. 01 Spring 2015 Information Systems CS507 idea solution spring 2015 Xpert 0 2,451 05-15-2015, 03:49 AM
Last Post: Xpert

Forum Jump:


Users browsing this thread: 1 Guest(s)