@@ -20,14 +19,16 @@ Some additional features we've implemented past the baseline requirements includ
We utilized the JavaFX library which is an open-source graphics library for Java. This is a relatively lightweight library with ease of use at the cost of performance. The initial reading of data constructs an Adjacency list which permits us to easily read in each vertex and access adjacency for further operations. Using the Adjacency List we base a TriangleMesh off of it to store the vertices of each triangle and respective face which constructs the object. Since we look at each vertex a constant number of times, the preprocessing for the object and javaFX simulation is at most O(n) time.
The simulation is then drawn at most 60 frames a second. For each frame, all code including collisions, obstacles, camera, and physics is updated just once and runs for a small constant time period. However, deformation is currently not implemented with clustering of points and as such checks every point, meaning that deformation runs at O(60n) time each second which becomes a significant impact on framerate and as such will be optimized for the final report.
The simulation is then drawn at most 60 frames a second. For each frame, all code including collisions, obstacles, camera, and physics is updated just once and runs for a small constant time period.
The way movement is done is by multiplying the original mesh by a translation factor in the x,y,z directions. This can be done efficiently due to the triangle mesh structure and takes only a constant time when printing to the graphics window. Therefore, all of our current physics and collisions are done only in x, y, and z axes, meaning that we do not currently implement rotational velocity and physics.
Currently we do not have a user friendly UI, and only one object can be loaded from command line, but multiple can be from initializing just another Moving Object class and adding it to the graphics group. In our programs in MillionTriangles we just have one which comes from the command line, and GraphicsAndWindowTest has two extra MovingObjects which are teapots which are implemented in the code to run alongside the command line shape.
We now have a UI which allows you to select from multiple objects or upload your own by selecting a file on your computer. Additionally you are able to specify the number of obstacles and game elements you would like to generate as well with up to 3 different bouncing shapes.
Physics is implemented by integration with the MovingObject where the velocity and acceleration are changed for the object itself and update the translation of the original mesh. Same for collisions which directly are handled by accessing MovingObject elements in constant time.
Deformation is limited to bouncing along each side without rotation, simplifying data structure design to be able to cache points of deformation where the object collides on its side and then deforms and reforms by updating the translation of individual points. This runs in O(V) time on initial calculation which is done in preprocessing, but only a fraction of that time when doing actual deformation. The amount of deformation scales with the speed of impact.
We have two separate files that we are currently working with: [GraphicsAndWindowTest](https://agile.bu.edu/gitlab/ec504/ec504_projects/group2/-/blob/master/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java?ref_type=heads) and [MillionTriangles](https://agile.bu.edu/gitlab/ec504/ec504_projects/group2/-/blob/master/src/main/java/org/example/newmat/MillionTriangle.java?ref_type=heads). The reason we have the split is to demonstrate the different portions of our project working where it is easier to see individual parts.
[MillionTriangles.java](https://agile.bu.edu/gitlab/ec504/ec504_projects/group2/-/blob/master/src/main/java/org/example/newmat/MillionTriangle.java?ref_type=heads) is essentially an updated version of the minimum requirements where we have a physics engine with proper deformation and user input working on a single shape with at least 1 fps on the lab computers.
@@ -48,14 +49,12 @@ We have two separate files that we are currently working with: [GraphicsAndWindo
## List of Features
- [ ] Apply shading to your triangles from some, user-configurable light source. [10%]
- Utilized JavaFX point and ambient light sources to provide lighting upon the bouncing figures and obstacle field. (80 % done)
- [ ] Add 100 fixed (immovable) obstacles to the environment of the bouncing figure. [15%]
- To implement the 100 obstacles, we made two classes. One is the Obstacle class which takes in the x,y, and z coordinates of the obstacle as well as customizable parameters such as the ability to remove it, the color, the shape, and the size. We also had an ObstacleField class which stores an array of Obstacles and randomizes their position within the window. Within these classes, we utilized the Bounds class which creates a Cube around the shape for collision detection. (100 % done)
- [ ] Add a physics engine to your bouncing shape, including a gravity source and a model for the elasticity of triangle edges. [15%]
- The physics engine is embedded for the objects where at each frame the object's physics is updated, using the frames as the measure of time for each update for both velocity and acceleration. The velocity and acceleration simply changes the translation of the image mentioned in the implementation. Collision is done the same way where we check the bounds of an object using the triangleMesh structure and change the translation accordingly if the bounds overlap with the bounds of another object. (80 % done)
- The physics engine is embedded for the objects where at each frame the object's physics is updated, using the frames as the measure of time for each update for both velocity and acceleration. The velocity and acceleration simply changes the translation of the image mentioned in the implementation. Collision is done the same way where we check the bounds of an object using the triangleMesh structure and change the translation accordingly if the bounds overlap with the bounds of another object. (100 % done)
- [ ] Bounce around more than one (1-million triangle) figures at the same time. [+15% per each additional figure, max of 2]
- We just implement the object as a separate class which means we can instantiate multiple instances of the same object with different parameters. Currently multiple objects with 1 million triangles is too slow in fps which is why we have separate files we demonstrate. (80 % done)
- We just implement the object as a separate class which means we can instantiate multiple instances of the same object with different parameters. Currently multiple objects with 1 million triangles is too slow in fps which is why we have separate files we demonstrate. (100 % done)
- [ ] Develop this into a game that includes the mouse to affect the motion of the figure and maintains scoring based on object collisions. [30%]
- To implement the game aspect, we used JavaFX internal box coordinates as anchor and release locations which would send the objects flying towards the direction of the mouse release. The calculation of the launch velocity was calculated based on the distance of those two coordinate locations. For 3rd direction movement, we implemented a keyboard input which takes W or S keyboard input to move the figures into that direction.
- Created a setVelocity in MovableObject class to facilitate this process
@@ -80,6 +79,8 @@ We have two separate files that we are currently working with: [GraphicsAndWindo
- Created collisions between the side of the window and obstacles
- Updated deformation to properly change the shape and make it return to original form
- Updated camera to allow easy viewing of the game
- Updated deformation to save old deformations and reuse them to increase frame rate by caching deformation
- Debugged deformation to no longer cause bugs with specific side collisions
### Haven
- Wrote commandline parser for the first object and read in of file
@@ -93,11 +94,6 @@ We have two separate files that we are currently working with: [GraphicsAndWindo
- Created visible normalized window
- Normalized Coordinates
### John
#### (Missing Person: We have not been able to contact John since last Wednesday, we have attempted to contact him by phone, discord, and social media. As a result, we will be submitting a Wellness Check request with the BU police because we are worried for his well being as this has not been his MO. However, with him missing, he has not contributed to any feature development or any project progress since minimum requirements were submitted.)
Change 0: Issue #8. We updated the shape to fulfill the basic requirements of starting in the middle of a normalized window.
Change 1: Issue #9. Shoot line position was forced to be on one window previously, but now we have the line properly update without reliant on camera rotation so that the line is independent of window.
Change 2: Issue #17. Bouncing with the mouse was previously not responsive. Now with the changed line it is working correctly and direction is more easily observed.
Change 3: Issue #16. We added a reset button, ESC key to reset to the UI page allowing users to restart and reset the simulation
## Rejected feedback
Change 0: Issue #12. We reject the lighting changes because we discontinued that feature and decided to keep it at that stage after discussion with instructor.
Change 1: Issue #15. Floor should block box view and show not be removed as the floor is meant to be an opaque object.
Change 2: Issue #11. Cool concept to have a splitable object, but we simply do not intend to make that due to the game concept we are utilizing.
Change 3: Issue #10, Issue #7, Issue #13, Issue #14. We did not have time to implement these changes.
Change 4: Issue #5. We tried to implement this but ran into issues with creating an object off of the JavaFX and we ran out of time. We document this in the README.
Change 5: Issue #6. Warning is for non lab computers and our priority is to focus on lab computer specifications.
## Other Changes
Change 0: We added a user UI to modify shapes and obstacles.