Loading src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +9 −9 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class GraphicsAndWindowsTest extends Application { public void start(Stage stage) throws IOException { VisibleWindow sceneWindow = new VisibleWindow(500, 600, 200); Box ourWindow = sceneWindow.makeWindow(); //Obstacle obs = new Obstacle(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),10,100); Obstacle obs = new Obstacle(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),10,100); String[] ob2 = {"--image", "src/teapot.txt", "--speed", "20", "--dir", "4,", "10,", "6"}; String[] ob3 = {"--image", "src/teapot.txt", "--speed", "5", "--dir", "1,", "1,", "1"}; Loading @@ -73,7 +73,7 @@ public class GraphicsAndWindowsTest extends Application { group3D.getChildren().add(newObject3.getMesh()); group3D.getChildren().add(ourWindow); group3D.getChildren().add(new AmbientLight(Color.WHITE)); //obs.addToGroup(group3D); obs.addToGroup(group3D); // NOTE: Due to the perspectiveCamera it looks like it is rotating even though it isn't // If you comment out this line and the scene.setCamera(camera) line Loading Loading @@ -243,19 +243,19 @@ public class GraphicsAndWindowsTest extends Application { //mesh.getPoints().setAll(points); } /* if(obs.checkCollision(meshBounds)){ if(obs.checkCollision(meshBounds[i])){ switch (lastChanged){ case 1: directionX *= -1; case 1: direction[i][0] *= -1; case 2: directionY *= -1; case 2: direction[i][1] *= -1; case 3: directionZ *= -1; case 3: direction[i][2] *= -1; default: System.out.println(); } directionY *= -1; }*/ direction[i][1] *= -1; } objects[i].updateTranslate(objects[i].getTranslate().getX() + direction[i][0], objects[i].getTranslate().getY() + direction[i][1], objects[i].getTranslate().getZ() + direction[i][2]); System.out.println(Arrays.toString(objects[i].getCentroid())); objects[i].updateRays(); Loading target/classes/org/example/newmat/GraphicsAndWindowsTest$1.class +294 B (3.6 KiB) File changed.No diff preview for this file type. View original file View changed file target/classes/org/example/newmat/GraphicsAndWindowsTest.class +209 B (6.09 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +9 −9 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ public class GraphicsAndWindowsTest extends Application { public void start(Stage stage) throws IOException { VisibleWindow sceneWindow = new VisibleWindow(500, 600, 200); Box ourWindow = sceneWindow.makeWindow(); //Obstacle obs = new Obstacle(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),10,100); Obstacle obs = new Obstacle(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),10,100); String[] ob2 = {"--image", "src/teapot.txt", "--speed", "20", "--dir", "4,", "10,", "6"}; String[] ob3 = {"--image", "src/teapot.txt", "--speed", "5", "--dir", "1,", "1,", "1"}; Loading @@ -73,7 +73,7 @@ public class GraphicsAndWindowsTest extends Application { group3D.getChildren().add(newObject3.getMesh()); group3D.getChildren().add(ourWindow); group3D.getChildren().add(new AmbientLight(Color.WHITE)); //obs.addToGroup(group3D); obs.addToGroup(group3D); // NOTE: Due to the perspectiveCamera it looks like it is rotating even though it isn't // If you comment out this line and the scene.setCamera(camera) line Loading Loading @@ -243,19 +243,19 @@ public class GraphicsAndWindowsTest extends Application { //mesh.getPoints().setAll(points); } /* if(obs.checkCollision(meshBounds)){ if(obs.checkCollision(meshBounds[i])){ switch (lastChanged){ case 1: directionX *= -1; case 1: direction[i][0] *= -1; case 2: directionY *= -1; case 2: direction[i][1] *= -1; case 3: directionZ *= -1; case 3: direction[i][2] *= -1; default: System.out.println(); } directionY *= -1; }*/ direction[i][1] *= -1; } objects[i].updateTranslate(objects[i].getTranslate().getX() + direction[i][0], objects[i].getTranslate().getY() + direction[i][1], objects[i].getTranslate().getZ() + direction[i][2]); System.out.println(Arrays.toString(objects[i].getCentroid())); objects[i].updateRays(); Loading
target/classes/org/example/newmat/GraphicsAndWindowsTest$1.class +294 B (3.6 KiB) File changed.No diff preview for this file type. View original file View changed file
target/classes/org/example/newmat/GraphicsAndWindowsTest.class +209 B (6.09 KiB) File changed.No diff preview for this file type. View original file View changed file