From b23738aa0a02031781234d7f3ec4e043f1e924b0 Mon Sep 17 00:00:00 2001 From: LouisJimenezHernandez Date: Sun, 28 Apr 2024 10:28:39 -0400 Subject: [PATCH] Fix for Git --- .idea/group2.iml | 9 - ..._org_apiguardian_apiguardian_api_1_1_2.xml | 14 - ...junit_jupiter_junit_jupiter_api_5_10_0.xml | 14 - ...it_jupiter_junit_jupiter_engine_5_10_0.xml | 14 - ...platform_junit_platform_commons_1_10_0.xml | 14 - ..._platform_junit_platform_engine_1_10_0.xml | 14 - .../Maven__org_openjfx_javafx_base_17_0_6.xml | 14 - ...en__org_openjfx_javafx_base_win_17_0_6.xml | 14 - ...en__org_openjfx_javafx_controls_17_0_6.xml | 14 - ...org_openjfx_javafx_controls_win_17_0_6.xml | 14 - .../Maven__org_openjfx_javafx_fxml_17_0_6.xml | 14 - ...en__org_openjfx_javafx_fxml_win_17_0_6.xml | 14 - ...en__org_openjfx_javafx_graphics_17_0_6.xml | 14 - ...org_openjfx_javafx_graphics_win_17_0_6.xml | 14 - ...Maven__org_opentest4j_opentest4j_1_3_0.xml | 14 - .idea/misc.xml | 4 +- .idea/modules.xml | 8 - .../GraphicsAndWindowsTest$1.class | Bin 4996 -> 0 bytes .../shelved.patch | 152 --------- ..._Update_at_4_15_2024_1_58_PM__Changes_.xml | 9 - .../GraphicsAndWindowsTest$2.class | Bin 830 -> 0 bytes .../GraphicsAndWindowsTest.class | Bin 8292 -> 0 bytes .../shelved.patch | 0 ..._Update_at_4_15_2024_2_03_PM__Changes_.xml | 14 - .../shelved.patch | 0 ...Update_at_4_16_2024_10_46_AM__Changes_.xml | 14 - .idea/workspace.xml | 292 ------------------ 27 files changed, 2 insertions(+), 696 deletions(-) delete mode 100644 .idea/group2.iml delete mode 100644 .idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml delete mode 100644 .idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_10_0.xml delete mode 100644 .idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_10_0.xml delete mode 100644 .idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_10_0.xml delete mode 100644 .idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_10_0.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_base_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_controls_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_6.xml delete mode 100644 .idea/libraries/Maven__org_opentest4j_opentest4j_1_3_0.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/GraphicsAndWindowsTest$1.class delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/shelved.patch delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM__Changes_.xml delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_2_03_PM_[Changes]/GraphicsAndWindowsTest$2.class delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_2_03_PM_[Changes]/GraphicsAndWindowsTest.class delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_2_03_PM_[Changes]/shelved.patch delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_2_03_PM__Changes_.xml delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_16_2024_10_46_AM_[Changes]/shelved.patch delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_4_16_2024_10_46_AM__Changes_.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/group2.iml b/.idea/group2.iml deleted file mode 100644 index d6ebd48..0000000 --- a/.idea/group2.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml b/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml deleted file mode 100644 index 5af7945..0000000 --- a/.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_2.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_10_0.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_10_0.xml deleted file mode 100644 index 1203a87..0000000 --- a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_10_0.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_10_0.xml b/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_10_0.xml deleted file mode 100644 index a75517d..0000000 --- a/.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_10_0.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_10_0.xml b/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_10_0.xml deleted file mode 100644 index 3505049..0000000 --- a/.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_10_0.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_10_0.xml b/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_10_0.xml deleted file mode 100644 index 0378690..0000000 --- a/.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_10_0.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_base_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_base_17_0_6.xml deleted file mode 100644 index 60a7ce3..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_base_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_6.xml deleted file mode 100644 index 1da6e15..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_base_win_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_controls_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_controls_17_0_6.xml deleted file mode 100644 index 6814fe4..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_controls_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_6.xml deleted file mode 100644 index 0bea98b..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_controls_win_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_6.xml deleted file mode 100644 index 6f490cb..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_fxml_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_6.xml deleted file mode 100644 index e8d4592..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_6.xml deleted file mode 100644 index 6ecf51d..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_graphics_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_6.xml b/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_6.xml deleted file mode 100644 index fb105ec..0000000 --- a/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_17_0_6.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_opentest4j_opentest4j_1_3_0.xml b/.idea/libraries/Maven__org_opentest4j_opentest4j_1_3_0.xml deleted file mode 100644 index 45b3f10..0000000 --- a/.idea/libraries/Maven__org_opentest4j_opentest4j_1_3_0.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 82dbec8..93f5f20 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + - \ No newline at end of file + diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index f62b41c..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/GraphicsAndWindowsTest$1.class b/.idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/GraphicsAndWindowsTest$1.class deleted file mode 100644 index b99bc3c54136beeaa82c742e3a88999a10c4a303..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4996 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 Z9nLEMLh~*@Ffkr{$T^+2m#qSS{{`3r#_Iq8 diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/shelved.patch deleted file mode 100644 index 33307ba..0000000 --- a/.idea/shelf/Uncommitted_changes_before_Update_at_4_15_2024_1_58_PM_[Changes]/shelved.patch +++ /dev/null @@ -1,152 +0,0 @@ -Index: src/main/java/org/example/newmat/GraphicsAndWindowsTest.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP -<+>package org.example.newmat;\r\nimport Graph.readFile;\r\nimport Shape.MovingObject;\r\nimport Shape.VisibleWindow;\r\nimport Shape.Obstacle;\r\nimport Shape.ObstacleField;\r\n\r\nimport javafx.animation.AnimationTimer;\r\nimport javafx.application.Application;\r\nimport javafx.geometry.Bounds;\r\nimport javafx.geometry.Point3D;\r\nimport javafx.geometry.Pos;\r\nimport javafx.scene.*;\r\nimport javafx.scene.control.Label;\r\nimport javafx.scene.input.KeyEvent;\r\nimport javafx.scene.layout.StackPane;\r\nimport javafx.scene.paint.Color;\r\nimport javafx.scene.paint.PhongMaterial;\r\nimport javafx.scene.shape.*;\r\nimport javafx.scene.transform.Rotate;\r\nimport javafx.scene.transform.Translate;\r\nimport javafx.stage.Stage;\r\n\r\nimport java.io.IOException;\r\nimport java.util.Arrays;\r\nimport java.util.List;\r\n\r\nimport static java.lang.Math.abs;\r\n\r\n\r\n/**\r\n * Demonstrates advanced JavaFX graphics and window management by creating a 3D scene with\r\n * animated elements and FPS (Frames Per Second) counter.\r\n *

\r\n * This application creates a 3D scene containing a textured cube and a dynamically generated\r\n * mesh based on input parameters. It showcases the handling of 3D transformations, animation,\r\n * camera movement, and basic input from the keyboard to manipulate the scene. Additionally,\r\n * it includes a real-time FPS counter overlaid on the scene to monitor performance.\r\n */\r\npublic class GraphicsAndWindowsTest extends Application {\r\n //public static String[] parameters;\r\n public static MovingObject[] objects;\r\n /**\r\n * Starts the JavaFX application.\r\n * This method initializes the 3D scene with its objects, animation timer, and event handlers.\r\n *\r\n * @param stage The primary stage for this application, onto which the scene is set.\r\n * @throws IOException If there is an issue reading the input file for generating the mesh.\r\n */\r\n @Override\r\n public void start(Stage stage) throws IOException {\r\n double windowXOffset = 600;\r\n double windowYOffset = 200;\r\n VisibleWindow sceneWindow = new VisibleWindow(500, -250, -250);\r\n Box ourWindow = sceneWindow.makeWindow();\r\n\r\n\r\n ObstacleField obs = new ObstacleField(sceneWindow.getWindowSize(),sceneWindow.getXOffset(),\r\n sceneWindow.getYOffset(),350,50, 100, 60, \"Box\",\r\n Color.ORANGERED, false);\r\n\r\n String[] ob2 = {\"--image\", \"src/teapot.txt\", \"--speed\", \"32\", \"--dir\", \"4,\", \"7,\", \"10\"};\r\n String[] ob3 = {\"--image\", \"src/teapot.txt\", \"--speed\", \"5\", \"--dir\", \"1,\", \"1,\", \"1\"};\r\n //String[] ob4 = {\"--image\", \"src/teapot.txt\", \"--speed\", \"100\", \"--dir\", \"3,\", \"5,\", \"7\"};\r\n MovingObject newObject1 = new MovingObject(getParameters().getRaw().toArray(new String[0]));\r\n MovingObject newObject2 = new MovingObject(ob2);\r\n MovingObject newObject3 = new MovingObject(ob3);\r\n //MovingObject newObject4 = new MovingObject(ob4);\r\n objects = new MovingObject[3];\r\n objects[0] = newObject1;\r\n objects[1] = newObject2;\r\n objects[2] = newObject3;\r\n //objects[3] = newObject4;\r\n\r\n\r\n Group group3D = new Group(); // Group of our 3D elements\r\n for (MovingObject o : objects ) {\r\n o.setTranslate(sceneWindow.getXOffset(), sceneWindow.getYOffset(),0);\r\n group3D.getChildren().add(o.getMesh());\r\n }\r\n\r\n group3D.setTranslateX(windowXOffset);\r\n group3D.setTranslateY(windowYOffset);\r\n group3D.setTranslateZ(250);\r\n group3D.getChildren().add(ourWindow);\r\n group3D.getChildren().add(new AmbientLight(Color.WHITE));\r\n obs.addToGroup(group3D);\r\n\r\n // NOTE: Due to the perspectiveCamera it looks like it is rotating even though it isn't\r\n // If you comment out this line and the scene.setCamera(camera) line\r\n // You will see it move without the rotation effect\r\n // I think this is pretty cool\r\n Camera camera = new PerspectiveCamera();\r\n camera.setNearClip(.1);\r\n camera.setFarClip(2000);\r\n camera.setTranslateX(-125);\r\n camera.setTranslateY(-250);\r\n camera.setTranslateZ(-250);\r\n\r\n //https://stackoverflow.com/questions/65510979/move-camera-relative-to-view-in-javafx\r\n //Incorporated the code from this post\r\n Point3D xAxis = new Point3D(1,0,0);\r\n Point3D yAxis = new Point3D(0,1,0);\r\n Rotate groupRotX = new Rotate(0, xAxis);\r\n Rotate groupRotY = new Rotate(0, yAxis);\r\n\r\n\r\n group3D.getTransforms().addAll(groupRotY, groupRotX);\r\n\r\n stage.addEventHandler(KeyEvent.KEY_PRESSED, event -> {\r\n switch(event.getCode()){\r\n case LEFT:\r\n groupRotY.setAngle(groupRotY.getAngle() + 10);\r\n break;\r\n case RIGHT:\r\n groupRotY.setAngle(groupRotY.getAngle() - 10);\r\n break;\r\n case UP:\r\n groupRotX.setAngle(groupRotX.getAngle() + 10);\r\n break;\r\n case DOWN:\r\n groupRotX.setAngle(groupRotX.getAngle() - 10);\r\n break;\r\n\r\n }\r\n });\r\n\r\n /*\r\n * SubScene to handle 3D components\r\n * Makes it easier to have 2D and 3D components in the same animation\r\n */\r\n SubScene subScene3D = new SubScene(group3D, 1500, 800);\r\n subScene3D.setFill(Color.SILVER);\r\n subScene3D.setCamera(camera);\r\n\r\n\r\n /*\r\n * Text label to display FPS\r\n */\r\n Label fpsLabel = new Label(\"FPS: 0\");\r\n fpsLabel.setTextFill(Color.WHITE);\r\n\r\n Label scoreLabel = new Label(\"Score: 0\");\r\n fpsLabel.setTextFill(Color.WHITE);\r\n //Lays out the children in Z order with the last member being front most\r\n //Effectively allows you to layer multiple elements\r\n //We are layering our 3D scene with a 2D label on top of it\r\n StackPane Layers = new StackPane();\r\n Layers.getChildren().addAll(subScene3D, fpsLabel, scoreLabel);\r\n StackPane.setAlignment(fpsLabel, Pos.BOTTOM_RIGHT); //Places FPS in bottom right\r\n StackPane.setAlignment(scoreLabel, Pos.TOP_LEFT); //Places FPS in bottom right\r\n\r\n\r\n Scene scene = new Scene(Layers, 1500, 800);\r\n\r\n stage.setTitle(\"FPS test\");\r\n stage.setScene(scene);\r\n stage.show();\r\n\r\n // Animation logic to move the Box back and forth\r\n AnimationTimer timer = new AnimationTimer() {\r\n private long lastUpdate = 0; //Movement timer\r\n private long fpsTimer = 0; //Frame timer\r\n private long frameRate = 0; //Frames per second\r\n private long score = 0; //Frames per second\r\n\r\n\r\n\r\n /**\r\n * Called at every frame while the {@link AnimationTimer} is active to update the scene's elements,\r\n * including object movements, boundary condition checks, mesh deformation on collision, and FPS counter updates.\r\n *

\r\n * This method extends the scene update logic with collision detection between the mesh and a virtual bounding box,\r\n * causing mesh deformation upon nearing the box's edges. It calculates new positions for 3D objects based on their\r\n * current positions and direction vectors, simulates movement within the scene, and reverses the movement direction\r\n * at the scene's boundaries. Additionally, it modifies the mesh's vertices to \"squish\" the mesh when it comes close\r\n * to or collides with the bounding box, creating a more dynamic interaction between the scene's objects.\r\n *

\r\n * Movement, boundary checking, and mesh deformation logic are applied based on the bounds of the 3D mesh and cube within the scene.\r\n * The FPS counter is updated once every second, based on the number of frames rendered in that interval, to provide real-time\r\n * performance feedback.\r\n *\r\n * @param now The timestamp of the current frame given in nanoseconds. This value is used to ensure smooth animations and\r\n * consistent updates across frames.\r\n */\r\n @Override\r\n public void handle(long now) {\r\n //Built in class that helps calculate the bounds of the mesh for collision\r\n Bounds[] meshBounds = new Bounds[objects.length];\r\n double[][] direction = new double[objects.length][3];\r\n for (int i = 0; i < objects.length; i++) {\r\n meshBounds[i] = objects[i].getMesh().getBoundsInParent();\r\n direction[i] = objects[i].getVelocityVec();\r\n }\r\n //Number is roughly 1 mill divided by 60\r\n if (now - lastUpdate >= 16_000_000) { // Roughly 60 frames per second\r\n int lastChanged = 1;\r\n double winLeftXBound = sceneWindow.getXOffset();\r\n double winTopYBound = sceneWindow.getYOffset();\r\n double WindowSize = sceneWindow.getWindowSize();\r\n // Reverse direction at bounds\r\n for (int i = 0; i < objects.length; i++) {\r\n double GRAVITY = 1;\r\n double AIRRESISTANCE = 0.03;\r\n //Physics updates\r\n //Gravity\r\n direction[i][1] += GRAVITY;\r\n\r\n //air resistance computation\r\n double mag = 0;\r\n for (int j = 0; j < 3; j++ ) {\r\n mag += Math.pow(direction[i][j],2);\r\n }\r\n mag = Math.sqrt(mag);\r\n double airResistance = mag * AIRRESISTANCE;\r\n direction[i][0] = direction[i][0] - (direction[i][0] / mag * airResistance);\r\n direction[i][1] = direction[i][1] - (direction[i][1] / mag * airResistance);\r\n direction[i][2] = direction[i][2] - (direction[i][2] / mag * airResistance);\r\n\r\n\r\n double x = direction[i][0];\r\n double y = direction[i][1];\r\n double z = direction[i][2];\r\n\r\n // the following will be class methods in the future\r\n // Window Collision computation for X\r\n if (meshBounds[i].getMinX() + direction[i][0] < winLeftXBound || meshBounds[i].getMaxX() + direction[i][0] > winLeftXBound + WindowSize) {\r\n\r\n if (meshBounds[i].getMinX() + x < winLeftXBound) {\r\n x = direction[i][0] + (winLeftXBound - (meshBounds[i].getMinX() + x));\r\n direction[i][0] += 1;\r\n } else {\r\n x = direction[i][0] - (meshBounds[i].getMaxX() + direction[i][0] - (winLeftXBound + WindowSize));\r\n }\r\n direction[i][0] *= -1;\r\n lastChanged = 1;\r\n\r\n }\r\n\r\n // Window Collision computation for Y\r\n if (meshBounds[i].getMinY() + direction[i][1] < winTopYBound || meshBounds[i].getMaxY() + direction[i][1] > winTopYBound + WindowSize) {\r\n\r\n if (meshBounds[i].getMinY() + y < winTopYBound) {\r\n y = direction[i][1] + (winTopYBound - (meshBounds[i].getMinY() + y));\r\n direction[i][1] += 1;\r\n } else {\r\n y = direction[i][1] - (meshBounds[i].getMaxY() + direction[i][1] - (winTopYBound + WindowSize));\r\n }\r\n direction[i][1] *= -1;\r\n lastChanged = 2;\r\n }\r\n\r\n // Window Collision computation for Z\r\n if (meshBounds[i].getMinZ() + direction[i][2] < 0 || meshBounds[i].getMaxZ() + direction[i][2] > WindowSize) {\r\n if (meshBounds[i].getMinZ() + z < 0) {\r\n z = direction[i][2] + (0 - (meshBounds[i].getMinZ() + z));\r\n direction[i][2] += 1;\r\n } else {\r\n z = direction[i][2] - (meshBounds[i].getMaxZ() + direction[i][2] - (WindowSize));\r\n }\r\n\r\n direction[i][2] *= -1;\r\n lastChanged = 3;\r\n }\r\n\r\n List collisionSide = obs.checkCollision(meshBounds[i]);\r\n if(!(collisionSide.get(0).equals(\"NONE\"))){\r\n switch ((String)collisionSide.get(0)){\r\n case \"LEFT\":\r\n direction[i][0] = abs(direction[i][0]);\r\n break;\r\n\r\n case \"RIGHT\":\r\n direction[i][0] = -1 * abs(direction[i][0]);\r\n break;\r\n\r\n case \"TOP\":\r\n direction[i][1] = abs(direction[i][1]);\r\n break;\r\n\r\n case \"BOTTOM\":\r\n direction[i][1] = -1 * abs(direction[i][1]);\r\n break;\r\n\r\n case \"FRONT\":\r\n direction[i][2] = abs(direction[i][2]);\r\n break;\r\n\r\n case \"BACK\":\r\n direction[i][2] = -1 * abs(direction[i][2]);\r\n break;\r\n\r\n default: System.out.println();\r\n }\r\n }\r\n objects[i].updateTranslate(x, y, z);\r\n System.out.println(Arrays.toString(objects[i].getCentroid()));\r\n //objects[i].updateRays();\r\n }\r\n lastUpdate = now;\r\n }\r\n if (fpsTimer == 0) {\r\n fpsTimer = now; // Initialize the FPS timer\r\n }\r\n frameRate++; // Increment frame count for each invocation\r\n //1 mill nanoseconds in a second\r\n if (now - fpsTimer >= 1_000_000_000) { // Every second, update the FPS display\r\n fpsLabel.setText(String.format(\"FPS: %d\", frameRate));\r\n frameRate = 0; // Reset frame count\r\n fpsTimer = now; // Reset the FPS timer\r\n score++;\r\n scoreLabel.setText(String.format(\"Score: %d\", score));\r\n }\r\n\r\n }\r\n };\r\n timer.start();\r\n }\r\n /**\r\n * The entry point of the application. This method is called when the application starts.\r\n *\r\n * @param args Command-line arguments passed to the application. Expected to contain\r\n * parameters for mesh generation and other configurations.\r\n */\r\n public static void main(String[] args) {\r\n Application.launch(args);\r\n }\r\n}\r\n -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java b/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java ---- a/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java (revision e56ab52acb052830eac274c4bc7a0086a8ee4d52) -+++ b/src/main/java/org/example/newmat/GraphicsAndWindowsTest.java (date 1713202988833) -@@ -7,12 +7,15 @@ - - import javafx.animation.AnimationTimer; - import javafx.application.Application; -+import javafx.beans.property.DoubleProperty; -+import javafx.beans.property.SimpleDoubleProperty; - import javafx.geometry.Bounds; - import javafx.geometry.Point3D; - import javafx.geometry.Pos; - import javafx.scene.*; - import javafx.scene.control.Label; - import javafx.scene.input.KeyEvent; -+import javafx.scene.input.MouseEvent; - import javafx.scene.layout.StackPane; - import javafx.scene.paint.Color; - import javafx.scene.paint.PhongMaterial; -@@ -38,6 +41,13 @@ - * it includes a real-time FPS counter overlaid on the scene to monitor performance. - */ - public class GraphicsAndWindowsTest extends Application { -+ -+ private double anchorX, anchorY; -+ private double anchorAngleX = 0; -+ private double anchorAngleY = 0; -+ private final DoubleProperty angleX = new SimpleDoubleProperty(0); -+ private final DoubleProperty angleY = new SimpleDoubleProperty(0); -+ - //public static String[] parameters; - public static MovingObject[] objects; - /** -@@ -56,11 +66,11 @@ - - - ObstacleField obs = new ObstacleField(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), -- sceneWindow.getYOffset(),350,50, 100, 60, "Box", -+ sceneWindow.getYOffset(),350,50, 100, 0, "Box", - Color.ORANGERED, false); - -- String[] ob2 = {"--image", "src/teapot.txt", "--speed", "32", "--dir", "4,", "7,", "10"}; -- String[] ob3 = {"--image", "src/teapot.txt", "--speed", "5", "--dir", "1,", "1,", "1"}; -+ String[] ob2 = {"--image", "src/sphereOut.txt", "--speed", "32", "--dir", "4,", "7,", "10"}; -+ String[] ob3 = {"--image", "src/sphereOut.txt", "--speed", "5", "--dir", "1,", "1,", "1"}; - //String[] ob4 = {"--image", "src/teapot.txt", "--speed", "100", "--dir", "3,", "5,", "7"}; - MovingObject newObject1 = new MovingObject(getParameters().getRaw().toArray(new String[0])); - MovingObject newObject2 = new MovingObject(ob2); -@@ -73,6 +83,8 @@ - //objects[3] = newObject4; - - -+ -+ - Group group3D = new Group(); // Group of our 3D elements - for (MovingObject o : objects ) { - o.setTranslate(sceneWindow.getXOffset(), sceneWindow.getYOffset(),0); -@@ -107,6 +119,7 @@ - - group3D.getTransforms().addAll(groupRotY, groupRotX); - -+ - stage.addEventHandler(KeyEvent.KEY_PRESSED, event -> { - switch(event.getCode()){ - case LEFT: -@@ -125,6 +138,7 @@ - } - }); - -+ - /* - * SubScene to handle 3D components - * Makes it easier to have 2D and 3D components in the same animation -@@ -133,6 +147,8 @@ - subScene3D.setFill(Color.SILVER); - subScene3D.setCamera(camera); - -+ initMouseControl(group3D, subScene3D); -+ - - /* - * Text label to display FPS -@@ -296,6 +312,8 @@ - objects[i].updateTranslate(x, y, z); - System.out.println(Arrays.toString(objects[i].getCentroid())); - //objects[i].updateRays(); -+ -+ - } - lastUpdate = now; - } -@@ -316,6 +334,31 @@ - }; - timer.start(); - } -+ -+ private void initMouseControl(Group group, SubScene scene){ -+ Rotate xRotate; -+ Rotate yRotate; -+ group.getTransforms().addAll( -+ xRotate = new Rotate(0, Rotate.X_AXIS), -+ yRotate = new Rotate(0, Rotate.Y_AXIS) -+ ); -+ xRotate.angleProperty().bind(angleX); -+ yRotate.angleProperty().bind(angleY); -+ -+ scene.setOnMouseClicked(mouseEvent -> { -+ anchorX = mouseEvent.getSceneX(); -+ anchorY = mouseEvent.getSceneY(); -+ anchorAngleX = angleX.get(); -+ anchorAngleY = angleY.get(); -+ -+ }); -+ -+ scene.setOnMouseDragged(mouseEvent -> { -+ angleX.set(anchorAngleX - (anchorY - mouseEvent.getSceneY())); -+ angleY.set(anchorAngleY - (anchorX - mouseEvent.getSceneX())); -+ -+ }); -+ } - /** - * The entry point of the application. This method is called when the application starts. - * -Index: .idea/misc.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP -<+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/misc.xml b/.idea/misc.xml ---- a/.idea/misc.xml (revision e56ab52acb052830eac274c4bc7a0086a8ee4d52) -+++ b/.idea/misc.xml (date 1713111428187) -@@ -7,9 +7,8 @@ - --