Lab- lets get twisted

Assignment Help Computer Graphics
Reference no: EM13909443

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

Reference no: EM13909443

Questions Cloud

Elisabeth kübler-ross proposed five psychological stages : Elisabeth Kübler-Ross proposed five psychological stages of dying: denial and isolation, anger, bargaining, depression, and acceptance. These stages do not occur in a specific order, and the stages often overlap. Dying people often have to rework the..
Compute the value of this stock : A firm does not pay a dividend. It is expected to pay its first dividend of $0.28 per share in three years. This dividend will grow at 10 percent indefinitely. Use an 11 percent discount rate. Compute the value of this stock
Compute and interpret the contribution margin ratio : Compute and interpret the contribution margin ratio using the following data: sales
Find the probability density of ui : Show that each inter-renewal interval Xi = Si - Si-1  (where S0  = 0) is the sum of two  independent rv s, Yi + Ui where Yi is the ith service time; find the probability density of Ui.
Lab- lets get twisted : 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 r..
Evaluate student''s understanding of grammatical operations : Objective: To evaluate student's understanding of grammatical operations and topic sentences recognition ability which makes him/her good English language reader.
Contribution margin per unit : SBD Phone Company sells its cordless phone for $ 90 per unit. Fixed costs total $ 162,000, and variable costs are $ 36 per unit.
Difference between server-side and client-side scripting? : difference between server-side and client-side scripting?
How will the break even point in units change in response : Refer to the information from QS 21 6. How will the break even point in units change in response to each of the following independent changes in selling price per unit, variable cost per unit, or total fixed costs?

Reviews

Write a Review

Computer Graphics Questions & Answers

  Describe how joint application design

Describe how joint application design

  Publishing and marketing plan a website

Without a publishing and marketing plan a website does not help the client to generate business. Your task in this part of the project is to think of a publishing and marketing plan for your website

  Implement an android application

When the application starts, it presents the user with a calendar displaying the dates of the current month and year and 6 buttons labelled Create Appointment, View/Edit Ap-pointments, Delete Appointment, Move Appointment, Search and Translate App..

  Quantify the objectives of the various projects the

quantify the objectives of the various projects the objectives of the sbu and the objectives of the parent company and

  Shadow effect while rolling a sphere

Shadow effect while rolling a sphere as well as the options of shading and lighting.

  Write a gui-based program that analyzes a round of golf

Write a GUI-based program that analyzes a round of golf. You will retrieve the data from 18 holes from a text file. On each line in the file will be the par for the hole(3, 4, or 5) and your score for that hole. Your program should read the file a..

  Question 1a portray for a split second the four essential

question 1a portray for a split second the four essential elements of a design pattern.b what are factories accountable

  Read the article values-based service brands narratives

read the article values-based service brands narratives from ikea by edvardsson from the readings for this module.

  The security policy document outline

Using the GDI Case Study below, complete the Security Policy Document Outline

  Design and implement a graphical user interface

Design and implement a graphical user interface (GUI) that lets a user draw geometric objects such as rectangles, line or circles segments. The geometric objects are two be "entered" with clicks of the mouse

  Media effects theories

Mass Media EffectsThe study of mass media effects has a long and storied history that predates the existence of the communication discipline itself. Yet, its breadth and scope have made it challenging for the area to gain coherence.

  1 on a day to day basis what are the general issues you

1. on a day to day basis what are the general issues you might deal with as a manger in the humane society animal

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd