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

  Create a simple warm-up program using your g3d

Create a simple warm-up program using your G3D programming and graphics environment.

  Shadow effect while rolling a sphere

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

  Relative positioning and interactive positioning

Relative Positioning and Interactive Positioning by Dragging and Clicking and some Simple Animation

  Draw a teapot at the global origin

Draw a teapot at the global origin

  Concepts of computer graphics

Concepts of Computer Graphics and develop a program using OpenGL

  The security policy document outline

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

  Develop the image manipulations

Develop the image manipulations

  What does resolution mean

What does resolution mean How is resolution connected to ppi and dpi units

  Differentiate between a bitmap image and a vector image

Differentiate between a bitmap image and a vector image Explain the following terms

  Essential elements of a design pattern

configuration of an Iterator pattern, patterns could be used in a Library System, Singleton, Template, Decorator, Façade,What does Alexander means by the following declaration "But it is impossible to form anything which has the temperament of natu..

  Framework of user interface design

design of user interfaces, natural mapping, GUI applications, web page design different to designing for printed media, risks exposed in this "phone as individual proxy" approach, interaction designers of ubicomp applications, Storyboards are usual..

  What are the factors affecting picture composition

Define picture composition What are the factors affecting picture composition. Elaborate on each factor Describe the basic lines present in a composition

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