Loading src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +13 −7 Original line number Diff line number Diff line Loading @@ -176,15 +176,21 @@ public class GraphicsAndWindowsTest extends Application { private double directionZ = 10.0; // Direction of movement /** * Called at every frame while the {@link AnimationTimer} is active. This method contains the logic for * updating the scene's elements, such as moving objects, checking for boundary conditions, and updating * the FPS counter displayed in the scene. * Called at every frame while the {@link AnimationTimer} is active to update the scene's elements, * including object movements, boundary condition checks, mesh deformation on collision, and FPS counter updates. * <p> * Movement and boundary checking are based on the bounds of the 3D mesh and the cube within the scene. * The FPS counter is updated once every second, based on the number of frames rendered in that interval. * This method extends the scene update logic with collision detection between the mesh and a virtual bounding box, * causing mesh deformation upon nearing the box's edges. It calculates new positions for 3D objects based on their * current positions and direction vectors, simulates movement within the scene, and reverses the movement direction * at the scene's boundaries. Additionally, it modifies the mesh's vertices to "squish" the mesh when it comes close * to or collides with the bounding box, creating a more dynamic interaction between the scene's objects. * <p> * Movement, boundary checking, and mesh deformation logic are applied based on the bounds of the 3D mesh and cube within the scene. * The FPS counter is updated once every second, based on the number of frames rendered in that interval, to provide real-time * performance feedback. * * @param now The timestamp of the current frame given in nanoseconds. This value can be used to * calculate the time difference between frames for smooth animation and movement. * @param now The timestamp of the current frame given in nanoseconds. This value is used to ensure smooth animations and * consistent updates across frames. */ @Override public void handle(long now) { Loading Loading
src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +13 −7 Original line number Diff line number Diff line Loading @@ -176,15 +176,21 @@ public class GraphicsAndWindowsTest extends Application { private double directionZ = 10.0; // Direction of movement /** * Called at every frame while the {@link AnimationTimer} is active. This method contains the logic for * updating the scene's elements, such as moving objects, checking for boundary conditions, and updating * the FPS counter displayed in the scene. * Called at every frame while the {@link AnimationTimer} is active to update the scene's elements, * including object movements, boundary condition checks, mesh deformation on collision, and FPS counter updates. * <p> * Movement and boundary checking are based on the bounds of the 3D mesh and the cube within the scene. * The FPS counter is updated once every second, based on the number of frames rendered in that interval. * This method extends the scene update logic with collision detection between the mesh and a virtual bounding box, * causing mesh deformation upon nearing the box's edges. It calculates new positions for 3D objects based on their * current positions and direction vectors, simulates movement within the scene, and reverses the movement direction * at the scene's boundaries. Additionally, it modifies the mesh's vertices to "squish" the mesh when it comes close * to or collides with the bounding box, creating a more dynamic interaction between the scene's objects. * <p> * Movement, boundary checking, and mesh deformation logic are applied based on the bounds of the 3D mesh and cube within the scene. * The FPS counter is updated once every second, based on the number of frames rendered in that interval, to provide real-time * performance feedback. * * @param now The timestamp of the current frame given in nanoseconds. This value can be used to * calculate the time difference between frames for smooth animation and movement. * @param now The timestamp of the current frame given in nanoseconds. This value is used to ensure smooth animations and * consistent updates across frames. */ @Override public void handle(long now) { Loading