Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

My project depends on previous homework because of that I posted all the questions to be clear, but the main project that I need help with is the homework3

Homework 1: Done and working great in the attachments
Programming problem: Interactive Natural Cubic Spline
In mathematics, a spline is a numeric function that is piecewise-defined by polynomial functions, and which possesses a high degree of smoothness at the places where the polynomial pieces connect (which are known as knots).
Cubic splines are the most popular spline functions. They are smooth functions with which to fit data, and when used for interpolation, they do not have the oscillatory behavior that is characteristic of high-degree polynomial interpolation.

The idea behind computing a cubic spline is as follows:

• Let s(x) = a(i) + b(i)*x + c(i)*x^2 + d(i)*x*3 for x(i-1)
• This gives 4*n unknown coefficients. So, we need 4*n constraints to solve the problem.
• First we require (i) s(x(i)) = y(i) for i = 0,1,...,n
• Next we require (ii) s(x(i)+0) = s(x(i)-0); (iii) s'(x(i)+0) = s'(x(i)-0); (iv) s''(x(i)+0) = s''(x(i)-0) for i = 1,...,n-1
• This gives us n+1 constraints from (i) and 3(n-1) constraints from (ii)-(iv). Thus, we have 4n-2 constraints leaving 2 degrees of freedom for choosing the coefficients.

Detail algorithm and pseudo code can be found on http://blog.ivank.net/interpolation-with-cubic-splines.html .

Your programming tasks include:

Interactively define the initial control spline, i.e. end-users will use the mouse to click points on the screen to define the vertices of the cubic spline, and the program should draw the current natural cubic spline every time a vertex is defined. You are also required to use the motion callback function to generate "picking-and-moving" of control vertices Receiving a character from keyboard as a keyboard event. The character invokes the following actions :
a. ‘q' or ‘Q': exit the program

b. ‘+' or ‘-': increase or decrease the interpolation steps between control points

Generate a menu for all of the above keyboard functionalities
a. Keyboard event ‘d' and mouse-picking to delete an existing control vertex
b. Keyboard ‘ ' (space bar) to close the spline as a closed natural cubic spline
Homework 2: not complete and don't works well with me in the attachments also

The programming problem is based on Homework #1. Our goal is now to extend the 2-dimensional spline into full 3-dimensional space, with user interface elements to rotate and scale the 3D graphic scene. Other tasks include using cylinders to replace the original 2D line segments, with colors and materials.

Your programming tasks include:

Extend the original cubic spline algorithms into 3D. Your mouse will be able to pick and move the control points, moving in x-y plane with mouse pointer, and moving in z-direction with the support of a modifier key.
Implement a "rolling-ball" interface to rotate the scene in 3D with mouse. Implement a "zoom-in/out" interface with mouse motion and a modifier key.
Replacing the line segment with cylinders, adding appropriate colors and materials.
When the rolling ball interface receives mouse event with momentum, the rotation will be kept until another mouse click happens.
Homework 3: I need help to achieve this part for now

The programming problem is based on Homework #2. Our goal is now to apply force-directed relaxation algorithm to refine the curve topology.

Two forces are used, an attractive "mechanical" force ( ) applied between adjacent beads on the same component and a repulsive "electrical" force ( ) applied between all other pairs of beads.
Your programming tasks include:

Implement the force model so that your sketched curves can be relaxed automatically to a refined shape.
Adding collision avoidance mechanism: during each iteration of shape refinement, check to determine if moving the bead to its desired location will cause the knot to move into an unsafe position. If so, bring the unsafe components apart to avoid collisions.

Adding a shadow to the 3D scene.

Implement view finding function, so that after each relaxation is done the system will rotate the curves into a position that users see the fewest intersections.
I post all the homework because it is related to each others, but I need help with the assignment 3 for now

Specific requirements: 1. Don't use external libraries just opengl glut

the first homework is a correct code use the same math for hw 3
I upload some of professor demo use it to help you

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91610851

Have any Question?


Related Questions in C/C++

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

  • 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