Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Graphics Expert

LAB- LET'S GET TWISTED

We will draw Bezier curves in this assignment, and some objects along them. You can add control points by left-clicking on the mouse. The points will be added to a list called "ptList[MAXPTNO]" and the variable "nPt" will record the number of points. Here are the tasks that you are supposed to do:

1. In your skeleton program, when you click a new point on the screen, it will be displayed as a black point. Your first task is to draw the control lines (green ones) by joining them. This control lines are being toggled by pressing the key "L" and by the variable "displayControlLines".

2. By pressing the key "E", you should erase all control points and start as new.

3. For every four points, draw a Bezier curve. So, the first 4 points, namely the 1st, 2nd, 3rd, and 4th points of your input, will form the first curve. Then the next curve is continuously formed by the 4th to 7th points (note that the 4th point is shared by two curves, so are the 7th, 10th,... etc). The second curve is NOT formed by the 5th to 8th points instead. The number of line segments to approximate the curve is in the variable NLINESEGMENT. You are NOT recommended to use the divide-and- conquer paradigm (De Casteljau Algorithm) in this assignment. This will just make things harder for you.

4. By pressing the key "C" (Toggle the variable "C1Continuity"), you will modify the SECOND point of all curves (except the first one) and make them C1 Continuous. The new second control point will be displayed in red, and the original second control point will be dimed as grey. And this function should be reversible. And all the functions in this assignment should be working in BOTH modes of being C1 Continuous and not C1 Continuous.

5. Draw the tangent vectors by pressing the key "T" (Toggle the variable "displayTangentVectors"). The number of tangent vectors you need to draw is in the variable NOBJECTONCURVE. There is already a function drawRightArrow() to draw an arrow for you.

6. At the same manner of the tangent vectors, draw copies of an object of your own creation along the curve (Toggled by "O" and the variable "displayObjects"). You can use your Assignment 1 if you want. The objects should be drawn on the reference frame with the tangent and the normal vectors on the curve. In the sample program, the object is simply ONE circle with two lines on the north and south poles of the circle. By repeating it on the curve, it looks like a worm.

7. Create one beautiful figure and submit "savefile.txt" together with your main.cpp. (There are two functions "R" and "W" provided for you to read and write your current control points into a file called "savefile.txt".)

Submit the zipped file of your whole directory, together with your "savefile.txt" for your drawing. However, please clean and delete any files unnecessary, e.g. the whole "Release" and "Debug" directories, and the "lab 4.ncb" file. The zip file should not be larger than 5 Mb. Also, submit a "readme.txt" if you have any extra features that are impressive or any explanation of your program.

Final note: All the reshape, resize functions should be already handled. Unless you messed them up, you should not need to take care of them. You can also assume all the points input are within the 600 x 600 windows of the screen. Last but not the least; this is a new assignment for this year. There may be some amendments or modifications, please follow tightly with the forum.

1874_img.png

Attachment:- Assignment.rar

Computer Graphics, Computer Science

  • Category:- Computer Graphics
  • Reference No.:- M91582378
  • Price:- $280

Guranteed 48 Hours Delivery, In Price:- $280

Have any Question?


Related Questions in Computer Graphics

Question a describe the architecture of simple raster

Question : a) Describe the architecture of simple raster graphics system? b) Explain raster scan display processor?

Please read my question if you post copy and pasted code

Please read my question if you post copy and pasted code you will get a negative review. This is java In this graphical program, you are going to simulate arcade car racing game. You need a single player that is movable ...

The problemyou are to search a bitmap in rgb format and

The problem: You are to search a bitmap in RGB format and count the number of pixels which match a set of colors. The bitmap will be 1024 by 1024 pixels for the purposes of explaining this problem. The set of colors will ...

The saffir-simpson hurricane scale classifies hurricanes

The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hurricane that outputs a hurricane's category based on the user's input of the wind speed. CA ...

You have a program draw a rectangle on the screen and allow

You have a program draw a rectangle on the screen and allow the user to change the color/size of the rectangle. The program will store in the browser the settings of the color/size so that upon revisiting the page, the v ...

The problemsit is strongly recommended that you tackle the

The problems: It is strongly recommended that you tackle the following tasks in a modular way -- a separate standalone function for each task. Draw a rectangle as a Rectangle and as a Polygon. Make the lines of the Polyg ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As