1. Homepage
  2. Programming
  3. CISC/CMPE 454 Computer Graphics - Assignment 3 - Physical Simulator

CISC/CMPE 454 Computer Graphics - Assignment 3 - Physical Simulator

Engage in a Conversation
CanadaQueen's UniversityCISC 454CMPE 454Computer GraphicsOpenGLC++Physical Simulator

454 Assignment 3

You will implement parts of a physical simulator. CourseNana.COM

Step 0

In Linux or MacOS, go into the 'linux' or 'macos' directory, compile the code with 'make', then run it from the command line as CourseNana.COM

./anim ../tests/test1.txt

In Windows Visual Studio, double-click on the a2.vcxproj file, check that the command-line arguments in the Properties are CourseNana.COM

..\tests\test1.txt

and then compile and run the code. CourseNana.COM

NOTES: CourseNana.COM

- If you do not include a command-line argument, the program will
  generate random spheres.

- The last spheres generated are recorded in ../tests/lastSpheres.txt,
  which you can use for testing if you encounter an error in the
  randomly-generated spheres.

- We will test on different inputs.

You can drag the mouse with the left button down to move the viewpoint. Dragging up/down with the right mouse button zooms in and out. CourseNana.COM

Pressing 'p' pauses or unpauses. CourseNana.COM

Pressing 'c' shows the line between each sphere and its 'contactPoint', which will be useful for your debugging. Between spheres the line goes only half-way to the contact point on the other sphere. CourseNana.COM

Pressing '+' or '-' increases or decreases the simulation speed, which starts at half of real time. CourseNana.COM

Step 1

[1 mark] Implement pointToEdgeDistance() in linalg.cpp according to the comments above that function. CourseNana.COM

Step 2

[3 marks] Implement Sphere::distToRectangle() according to the comments in that function. CourseNana.COM

At this point you should test your code by running it on test1.txt. Press 'c' to see the closest point to the sphere, which should be the bottom of the pit. CourseNana.COM

Then move the sphere (in test1.txt) so that it is close to, but does not touch, one of the pit edges. Press 'c' and verify that the closest point is on the edge. CourseNana.COM

Then move the sphere outside one of the pit corner and test again that the closest point is now that corner. CourseNana.COM

Get this code tested and working before proceeding. CourseNana.COM

Step 3

[2 marks] Implement World::integrate() in world.cpp according to the comments in that function. CourseNana.COM

Now test this with the original test1.txt to see that the sphere accelerates downward. CourseNana.COM

Step 4

[3 marks] EFFICIENTY and CLEANLY implement the binary search in World::updateStateByDeltaT() according to the comments in that function. At least one mark is for clean and efficient code. CourseNana.COM

Step 5

[0 marks] Read and understand findCollisions(). CourseNana.COM

Step 6.

Implement sphere/sphere [3 marks] and sphere/rectangle [2 marks] collision resolution in World::resolveCollision() according to the comments in that function. CourseNana.COM

Do sphere/rectangle collision first and test it with the original test1.txt. Once that is working, move the sphere so that it hits an edge of the pit and test that the collision causes the sphere to move in the correct direction. CourseNana.COM

Finally, implement sphere/sphere collision and test it with test2.txt. CourseNana.COM

Then try several tests with many spheres by setting NUM_SPHERES_TO_GEN and not providing any command-line arguments. CourseNana.COM

To Hand In

Make a directory called 'a3'. In that directory, put CourseNana.COM

- a README.txt file with your name(s), student number(s), and netID(s)

- All of the *.h and *.cpp files, even if you did not modify them.

- DO NOT INCLUDE ANY OTHER FILES.  YOU WILL LOSE MARKS OTHERWISE.

Create a ZIP archive, named a3.zip, of the a3 directory and upload it to OnQ. CourseNana.COM

IN GROUPS OF TWO, ONLY ONE PERSON SHOULD UPLOAD THE ASSIGNMENT. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Canada代写,Queen's University代写,CISC 454代写,CMPE 454代写,Computer Graphics代写,OpenGL代写,C++代写,Physical Simulator代写,Canada代编,Queen's University代编,CISC 454代编,CMPE 454代编,Computer Graphics代编,OpenGL代编,C++代编,Physical Simulator代编,Canada代考,Queen's University代考,CISC 454代考,CMPE 454代考,Computer Graphics代考,OpenGL代考,C++代考,Physical Simulator代考,Canadahelp,Queen's Universityhelp,CISC 454help,CMPE 454help,Computer Graphicshelp,OpenGLhelp,C++help,Physical Simulatorhelp,Canada作业代写,Queen's University作业代写,CISC 454作业代写,CMPE 454作业代写,Computer Graphics作业代写,OpenGL作业代写,C++作业代写,Physical Simulator作业代写,Canada编程代写,Queen's University编程代写,CISC 454编程代写,CMPE 454编程代写,Computer Graphics编程代写,OpenGL编程代写,C++编程代写,Physical Simulator编程代写,Canadaprogramming help,Queen's Universityprogramming help,CISC 454programming help,CMPE 454programming help,Computer Graphicsprogramming help,OpenGLprogramming help,C++programming help,Physical Simulatorprogramming help,Canadaassignment help,Queen's Universityassignment help,CISC 454assignment help,CMPE 454assignment help,Computer Graphicsassignment help,OpenGLassignment help,C++assignment help,Physical Simulatorassignment help,Canadasolution,Queen's Universitysolution,CISC 454solution,CMPE 454solution,Computer Graphicssolution,OpenGLsolution,C++solution,Physical Simulatorsolution,