View more random threads:
- CS502 Fundamentals of Algorithms Assignment No. 02 Solution...
- CS301 Data Structure VU Current Assignment No. 1 semester...
- need assignment solution
- All Past Assignments with Solutions Of MGT402 Cost &...
- STA301 Assignment 4 Solution, June 2010
- MGT101 Fall 2010 october full and final solution
- STA301 Statistics and Probability Assignment No. 1 Solution...
- CS001 Computer Proficiency Assignment 1 Spring 2011 Idea...
- STA301 Statistics and Probability Assignment No.2 Ideal...
- CS403 Solution Assignment #1 Spring 2010
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
Sponsored Links
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
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