C++代写:CS4027 Four Questions


Question 1

This project is practicing with 2D collision geometry detection and resolution. A simple project is attached which generates 5 or more convex polygons and set them in movement in 2D space. Your tasks include:

  1. generate AABB and bounding circle for each polygon. For AABB just find the min x,y of all corners, and also max x, y of all corners. For circle, first use mean of x and y of all corners as the center. Then find the max distance of the center to all corners and use that as the radius.
    1.1. To detect collision between 2 object’s collision geometries use appropriate methods we talked about in classes, depending if the geometry are circles or AABBs. For AABBs just check if any of the corners of one AABB is inside of the other AABB.
  2. Add an option to UI to allow to choose between AABB or circle as collision geometry. Depending on which option is chosen, the bounding collision geometry should be rendered when the polygons are in collision.
  3. Add an option to UI to allow choosing to do resolution of collision or not. Collision resolution should be available only for bounding circle geometry.
  4. If collision resolution is chosen, you should proceed with circle-circle collision resolution. For this you must first push back the circles in the opposite direction of the motion until they are not colliding any more , to bring them back into starting collision state. Then reverse their velocity each.
  5. Add an option to UI to select OBB as Bounding volume. In this case OBB is computed using PCA, as explained in class. We also compute tightest Bounding Sphere here as well, as was explained in class.

Question 2

This project is about developing a console app to do some vector and matrix computation and print the result out to console to the user. Pay attention to do testing for edge case. The tool works by asking the user if they want to do vector calculus or matrix calculus. If user chooses vector, then it asks the user to input 2 3D vectors v1 and v2 in floating numbers. Your app will do the followings and print the results for each steps:
-check if the input vectors are not zero, then do the followings:

  1. Compute v1.v2 and print the result
  2. Computer v1 x v2 and print the resulting vector
  3. Compute Proj_v2 (v1) and print the resulting vector.
  4. Compute Proju v1(v2) and print the result
  5. Compute Perp_v1(v2) and print the result
  6. Compute Perp_v2(v1) and print the result.

If user chooses matrix, then ask user to provide a symmetric 3x3 matrix. Make sure the input is actually symmetric. If not ask user again.

Then use the eig3.cpp source code attached to this assignment to compute the eigenvalues and eigenvectors and print each pair of (eigenvalue, eigenvector) to the console. Make sure you normalize the eigenvectors before printing it.

Question 3

The attached is the project for implementing various integration methods for a simple Projectile. Your tasks include these:

  1. Currently there are 2 integration implemented, the precise one and explicit euler method. You must implement 3 other ones, whose shell function update and render calls are already in the code. This includes SE euler, Verlet, and RK4 method.
  2. add a damping force to the physics, as was explained in the pdf and shown in class. The damping force should be F = -kV. K is a small positive constant whose range is [0.f, 0.1]. In the UI you should be able to increase or decrease k by 0.02 increments.

Question 4

This is the interpolation and spline project, on implementing various interpolation and spline methods. The project already has linear spline and quadratic Lagrange interpolation method.
You must implement

  1. Quadratic Bezier among 3 points
  2. Cubic Bezier among 4 points
  3. Cutmul-Rom spline for n]4 points

You must add appropriate UI to support these features.

For hand in a clean solution, meaning no debug or release or .vs or db file should be included, is handed in as a zip file. It should contain release exe app for me to run. Make sure it works! and works in both debug and release version.