From: Svjatoslav Agejenko Date: Fri, 20 Mar 2026 21:03:25 +0000 (+0200) Subject: feat: add minimal example and improve docs X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=97aba9b443f513ecd499a3f658f4dde53262fd96;p=sixth-3d-demos.git feat: add minimal example and improve docs - Add MinimalExample minimal example - Add package-info.java for demo packages - Add descriptions to launcher demo buttons - Rename MyFirstScene to MinimalExample - Add explicit constructors to fix javadoc warnings - Rename screenshots and add developer tools section --- diff --git a/doc/Screenshots/Life.png b/doc/Screenshots/Life.png new file mode 100644 index 0000000..565f5ab Binary files /dev/null and b/doc/Screenshots/Life.png differ diff --git a/doc/Screenshots/Mathematical formulas.png b/doc/Screenshots/Mathematical formulas.png new file mode 100644 index 0000000..fab8469 Binary files /dev/null and b/doc/Screenshots/Mathematical formulas.png differ diff --git a/doc/Screenshots/Raytracing fractal in voxel polygon hybrid scene.png b/doc/Screenshots/Raytracing fractal in voxel polygon hybrid scene.png new file mode 100644 index 0000000..7094240 Binary files /dev/null and b/doc/Screenshots/Raytracing fractal in voxel polygon hybrid scene.png differ diff --git a/doc/Screenshots/Sine heightmap and sphere.png b/doc/Screenshots/Sine heightmap and sphere.png new file mode 100644 index 0000000..0d3e92b Binary files /dev/null and b/doc/Screenshots/Sine heightmap and sphere.png differ diff --git a/doc/Screenshots/Text editors 2.png b/doc/Screenshots/Text editors 2.png new file mode 100644 index 0000000..cb1733f Binary files /dev/null and b/doc/Screenshots/Text editors 2.png differ diff --git a/doc/Screenshots/Text editors.png b/doc/Screenshots/Text editors.png new file mode 100644 index 0000000..8567b8b Binary files /dev/null and b/doc/Screenshots/Text editors.png differ diff --git a/doc/index.org b/doc/index.org index 92d3d10..f76fea1 100644 --- a/doc/index.org +++ b/doc/index.org @@ -88,7 +88,7 @@ devised by the British mathematician John Horton Conway in 1970. otherwise it dies. + Dead cell becomes alive if neighbors count is exactly 3. -[[file:screenshots/life.png]] +[[file:Screenshots/Life.png]] Current application projects 2D game grid/matrix onto three dimensional space. Extra dimension (height) is used to visualize @@ -108,7 +108,7 @@ Usage: :ID: 39250157-db8e-4861-a21b-8568912bd160 :END: -[[file:screenshots/text editors.png]] +[[file:Screenshots/Text editors.png]] Initial test for creating user interfaces in 3D and: + window focus handling @@ -149,28 +149,28 @@ again, window must be unfocused first using ESC key. *Quite a lot of text editors can be rendered:* -[[file:screenshots/text editors 2.png]] +[[file:Screenshots/Text editors 2.png]] See also [[https://hackers-1995.vercel.app/][similar looking web based demo]] ! :) ** Mathematical formulas :PROPERTIES: :CUSTOM_ID: mathematical-formulas -:ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890 +:ID: b1c2d3e4-f5a6-7890-bcde-f12345678901 :END: -[[file:screenshots/mathematical formulas.png]] +[[file:Screenshots/Mathematical formulas.png]] + TODO: instead of projecting 2D visualizations onto 3D space, visualize some formula using all 3 dimensions avaliable. -** Sine heightmaps and sphere +** Sine heightmap and sphere :PROPERTIES: :CUSTOM_ID: sine-heightmaps-and-sphere :ID: b2c3d4e5-f6a7-8901-bcde-f12345678901 :END: -[[file:screenshots/sinus heightmaps and sphere.png]] +[[file:Screenshots/Sine heightmap and sphere.png]] Simple test scene. Easy to implement and looks nice. @@ -180,7 +180,7 @@ Simple test scene. Easy to implement and looks nice. :ID: c3d4e5f6-a7b8-9012-cdef-123456789012 :END: -[[file:screenshots/raytracing fractal in voxel polygon hybrid scene.png]] +[[file:Screenshots/Raytracing fractal in voxel polygon hybrid scene.png]] Test scene that is generated simultaneously using: + conventional polygons @@ -239,6 +239,15 @@ Star Grid 256.88 ================================================================================ #+end_example +** Developer tools +:PROPERTIES: +:CUSTOM_ID: developer-tools +:ID: 8c5e2a1f-9d3b-4f6a-b8e7-1c4d5f7a9b2e +:END: + +Press *F12* in any demo to open the Developer Tools panel. This +debugging interface provides real-time insight into the rendering +pipeline with diagnostic toggles. * Source code :PROPERTIES: diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java index 5aa5e3f..1be37ee 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java @@ -26,6 +26,12 @@ import java.util.List; */ public class GraphDemo { + /** + * Creates a new GraphDemo instance. + */ + public GraphDemo() { + } + /** Frequency of the wave pattern in the wobbly surfaces. */ private static final double WAVE_FREQUENCY = 50d; /** Amplitude of the wave pattern in the wobbly surfaces. */ diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/MinimalExample.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/MinimalExample.java new file mode 100644 index 0000000..af755e8 --- /dev/null +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/MinimalExample.java @@ -0,0 +1,44 @@ +/* + * Sixth 3D engine demos. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. + * + */ +package eu.svjatoslav.sixth.e3d.examples; + +import eu.svjatoslav.sixth.e3d.geometry.Point3D; +import eu.svjatoslav.sixth.e3d.gui.ViewFrame; +import eu.svjatoslav.sixth.e3d.math.Transform; +import eu.svjatoslav.sixth.e3d.renderer.raster.Color; +import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection; +import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.solid.SolidPolygonRectangularBox; + +/** + * Minimal example demonstrating how to create a basic 3D scene. + *

+ * Creates a window with a single red box. This is the "Create Your First 3D Scene" + * example from the Sixth 3D documentation. + */ +public class MinimalExample { + + /** + * Entry point for the minimal scene demo. + * @param args command line arguments (ignored) + */ + public static void main(String[] args) { + ViewFrame viewFrame = new ViewFrame(); + ShapeCollection shapes = viewFrame.getViewPanel().getRootShapeCollection(); + + Transform boxTransform = new Transform(new Point3D(0, 0, 0), 0, 0); + SolidPolygonRectangularBox box = new SolidPolygonRectangularBox( + new Point3D(-50, -50, -50), + new Point3D(50, 50, 50), + Color.RED + ); + box.setTransform(boxTransform); + shapes.addShape(box); + + viewFrame.getViewPanel().getCamera().getTransform().setTranslation(new Point3D(0, -100, -300)); + + viewFrame.getViewPanel().ensureRenderThreadStarted(); + } +} \ No newline at end of file diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java index 6b3accc..14b62a3 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java @@ -35,6 +35,12 @@ import java.util.Vector; */ public class OctreeDemo extends WorldNavigationUserInputTracker { + /** + * Creates a new OctreeDemo instance. + */ + public OctreeDemo() { + } + /** Scale factor for rendering octree voxels in the scene. */ private static final double magnification = 5; private final LineAppearance gridAppearance = new LineAppearance(40, new Color(255, diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java index b3c9d3c..84cc65e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RainingNumbersDemo.java @@ -26,6 +26,12 @@ import java.util.Random; */ public class RainingNumbersDemo implements FrameListener { + /** + * Creates a new RainingNumbersDemo instance. + */ + public RainingNumbersDemo() { + } + /** Number of falling numbers in the scene. */ private static final int NUMBERS_COUNT = 1000; /** Size of the cubic area containing the numbers. */ diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java index 30c4ef9..7c04f2f 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/RandomPolygonsDemo.java @@ -21,6 +21,12 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D */ public class RandomPolygonsDemo { + /** + * Creates a new RandomPolygonsDemo instance. + */ + public RandomPolygonsDemo() { + } + /** Average size of each random polygon. */ private static final double POLYGON_AVERAGE_SIZE = 130; /** Number of polygons to generate. */ diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/ShadedShapesDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/ShadedShapesDemo.java index 7d0b27d..2969b4e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/ShadedShapesDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/ShadedShapesDemo.java @@ -23,6 +23,12 @@ import java.util.Random; */ public class ShadedShapesDemo { + /** + * Creates a new ShadedShapesDemo instance. + */ + public ShadedShapesDemo() { + } + /** Number of orbiting light sources in the scene. */ private static final int LIGHT_COUNT = 10; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java index c9292a5..450e100 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo.java @@ -27,6 +27,12 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid2D */ public class TextEditorDemo { + /** + * Creates a new TextEditorDemo instance. + */ + public TextEditorDemo() { + } + /** * Entry point for the text editor demo. * @param args command line arguments (ignored) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo2.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo2.java index 936aed6..79a183c 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo2.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/TextEditorDemo2.java @@ -35,6 +35,12 @@ import java.util.stream.Collectors; */ public class TextEditorDemo2 { + /** + * Creates a new TextEditorDemo2 instance. + */ + public TextEditorDemo2() { + } + /** * Entry point for the text editor city demo. * @param args command line arguments (ignored) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/WindingOrderDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/WindingOrderDemo.java index d81426f..3b9e893 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/WindingOrderDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/WindingOrderDemo.java @@ -25,6 +25,16 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon.SolidPo */ public class WindingOrderDemo { + /** + * Creates a new WindingOrderDemo instance. + */ + public WindingOrderDemo() { + } + + /** + * Entry point for the winding order demo. + * @param args command line arguments (ignored) + */ public static void main(String[] args) { ViewFrame viewFrame = new ViewFrame(); ViewPanel viewPanel = viewFrame.getViewPanel(); diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/SolidCubesTest.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/SolidCubesTest.java index d9e9773..e3d9abe 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/SolidCubesTest.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/SolidCubesTest.java @@ -21,6 +21,12 @@ import java.util.Random; */ public class SolidCubesTest implements BenchmarkTest { + /** + * Creates a new SolidCubesTest instance. + */ + public SolidCubesTest() { + } + private static final int GRID_SIZE = 16; private static final double SPACING = 80; private static final double CUBE_SIZE = 25; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/StarGridTest.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/StarGridTest.java index 967a621..8ba2f86 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/StarGridTest.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/StarGridTest.java @@ -21,6 +21,12 @@ import java.util.Random; */ public class StarGridTest implements BenchmarkTest { + /** + * Creates a new StarGridTest instance. + */ + public StarGridTest() { + } + private static final int GRID_SIZE = 16; private static final double SPACING = 80; private static final double STAR_SIZE = 20; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/TexturedCubesTest.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/TexturedCubesTest.java index c8f4798..c89cfe6 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/TexturedCubesTest.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/TexturedCubesTest.java @@ -20,6 +20,12 @@ import java.util.Random; */ public class TexturedCubesTest implements BenchmarkTest { + /** + * Creates a new TexturedCubesTest instance. + */ + public TexturedCubesTest() { + } + private static final int GRID_SIZE = 16; private static final double SPACING = 80; private static final double CUBE_SIZE = 25; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/WireframeCubesTest.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/WireframeCubesTest.java index c625627..7020f6d 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/WireframeCubesTest.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/benchmark/WireframeCubesTest.java @@ -21,6 +21,12 @@ import java.util.Random; */ public class WireframeCubesTest implements BenchmarkTest { + /** + * Creates a new WireframeCubesTest instance. + */ + public WireframeCubesTest() { + } + private static final int GRID_SIZE = 16; private static final double SPACING = 80; private static final double CUBE_SIZE = 25; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/PointCloudDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/PointCloudDemo.java index 02d3c3e..731b35e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/PointCloudDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/PointCloudDemo.java @@ -17,6 +17,12 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection; */ public class PointCloudDemo { + /** + * Creates a new PointCloudDemo instance. + */ + public PointCloudDemo() { + } + /** * Entry point for the point cloud demo. * @param args command line arguments (ignored) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/package-info.java new file mode 100644 index 0000000..a80d64b --- /dev/null +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/galaxy_demo/package-info.java @@ -0,0 +1,22 @@ +/* + * Sixth 3D engine demos. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. + */ + +/** + * Galaxy simulation demo using glowing points. + * + *

Creates a spiral galaxy visualization using + * {@link eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.GlowingPoint} + * shapes arranged in a mathematical spiral pattern.

+ * + *

Key classes:

+ * + * + * @see eu.svjatoslav.sixth.e3d.examples.galaxy_demo.Galaxy + */ + +package eu.svjatoslav.sixth.e3d.examples.galaxy_demo; \ No newline at end of file diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java index ea856e6..bd0d9a8 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/ApplicationListPanel.java @@ -2,11 +2,12 @@ * Sixth 3D engine demos. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. * -*/ + */ package eu.svjatoslav.sixth.e3d.examples.launcher; import eu.svjatoslav.sixth.e3d.examples.GraphDemo; +import eu.svjatoslav.sixth.e3d.examples.MinimalExample; import eu.svjatoslav.sixth.e3d.examples.OctreeDemo; import eu.svjatoslav.sixth.e3d.examples.RandomPolygonsDemo; import eu.svjatoslav.sixth.e3d.examples.RainingNumbersDemo; @@ -21,29 +22,102 @@ import java.awt.event.ActionEvent; /** * Panel containing buttons to launch each demo application. - * Displays a vertical list of buttons organized in a sequential group layout. + * Displays a vertical list with button and description for each demo. */ class ApplicationListPanel extends JPanel { private static final long serialVersionUID = 2012721856427052560L; - /** Constructs the panel with all demo launcher buttons. */ + private static final int BUTTON_WIDTH = 160; + private static final int GAP = 12; + + private record DemoEntry(String name, String description, AbstractAction action) {} + + private static final DemoEntry[] DEMOS = { + new DemoEntry("Minimal Example", + "Minimal example showing a single red box", + new ShowMinimalExample()), + new DemoEntry("Volumetric Octree", + "Octree-based rendering with on-demand raytracing", + new ShowOctree()), + new DemoEntry("Mathematical graphs", + "Function graphs rendered in 3D around a sphere", + new ShowMathGraphs()), + new DemoEntry("Point cloud galaxy", + "Spiral galaxy with 10,000 glowing points", + new ShowPointCloud()), + new DemoEntry("Raining numbers", + "Numbers falling through 3D space like rain", + new ShowRain()), + new DemoEntry("Text editors", + "5x5 grid of 3D text editor components", + new ShowTextEditors()), + new DemoEntry("Text editors city", + "3D city of text editor panels as buildings", + new ShowTextEditors2()), + new DemoEntry("Game of Life", + "Conway's Game of Life with 3D visualization", + new ShowGameOfLife()), + new DemoEntry("Random polygons", + "1000 semi-transparent triangles with depth sorting", + new ShowRandomPolygons()), + new DemoEntry("Shaded Shapes", + "Shapes lit by orbiting colored light sources", + new ShowShadedShapes()), + new DemoEntry("Graphics Benchmark", + "Automated performance measuring FPS across modes", + new ShowGraphicsBenchmark()), + }; + ApplicationListPanel() { - final GroupLayout groupLayout = new GroupLayout(this); - GroupLayout.SequentialGroup sequentialGroup = groupLayout.createSequentialGroup(); - sequentialGroup.addComponent(new JLabel("Choose an example to launch:")); - sequentialGroup.addComponent(new JButton(new ShowOctree())); - sequentialGroup.addComponent(new JButton(new ShowMathGraphs())); - sequentialGroup.addComponent(new JButton(new ShowPointCloud())); - sequentialGroup.addComponent(new JButton(new ShowRain())); - sequentialGroup.addComponent(new JButton(new ShowTextEditors())); - sequentialGroup.addComponent(new JButton(new ShowTextEditors2())); - sequentialGroup.addComponent(new JButton(new ShowGameOfLife())); - sequentialGroup.addComponent(new JButton(new ShowRandomPolygons())); - sequentialGroup.addComponent(new JButton(new ShowShadedShapes())); - sequentialGroup.addComponent(new JButton(new ShowGraphicsBenchmark())); + final GroupLayout layout = new GroupLayout(this); + setLayout(layout); + + layout.setAutoCreateGaps(true); + layout.setAutoCreateContainerGaps(true); + + final GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup(); + final GroupLayout.ParallelGroup horizontalButtonGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING); + final GroupLayout.ParallelGroup horizontalDescGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING); + + final JLabel headerLabel = new JLabel("Choose an example to launch:"); + headerLabel.setFont(headerLabel.getFont().deriveFont(java.awt.Font.BOLD)); + verticalGroup.addComponent(headerLabel); + horizontalButtonGroup.addComponent(headerLabel); + horizontalDescGroup.addComponent(headerLabel); + + for (final DemoEntry entry : DEMOS) { + final JButton button = new JButton(entry.action()); + button.setPreferredSize(new java.awt.Dimension(BUTTON_WIDTH, button.getPreferredSize().height)); + + final JLabel descLabel = new JLabel(entry.description()); + descLabel.setFont(descLabel.getFont().deriveFont(java.awt.Font.PLAIN)); + + verticalGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) + .addComponent(button) + .addComponent(descLabel)); + + horizontalButtonGroup.addComponent(button); + horizontalDescGroup.addComponent(descLabel); + } + + layout.setVerticalGroup(verticalGroup); + layout.setHorizontalGroup(layout.createSequentialGroup() + .addGroup(horizontalButtonGroup) + .addGap(GAP) + .addGroup(horizontalDescGroup)); + } + + private static class ShowMinimalExample extends AbstractAction { + ShowMinimalExample() { + putValue(NAME, "Minimal Example"); + } + + @Override + public void actionPerformed(final ActionEvent e) { + MinimalExample.main(null); + } } - /** Action to launch the TextEditorDemo. */ private static class ShowTextEditors extends AbstractAction { ShowTextEditors() { putValue(NAME, "Text editors"); @@ -55,7 +129,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the TextEditorDemo2 (city view). */ private static class ShowTextEditors2 extends AbstractAction { ShowTextEditors2() { putValue(NAME, "Text editors city"); @@ -67,8 +140,6 @@ class ApplicationListPanel extends JPanel { } } - - /** Action to launch the RainingNumbersDemo. */ private static class ShowRain extends AbstractAction { ShowRain() { putValue(NAME, "Raining numbers"); @@ -80,7 +151,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the PointCloudDemo (galaxy simulation). */ private static class ShowPointCloud extends AbstractAction { ShowPointCloud() { putValue(NAME, "Point cloud galaxy"); @@ -92,7 +162,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the GraphDemo (mathematical graphs). */ private static class ShowMathGraphs extends AbstractAction { ShowMathGraphs() { putValue(NAME, "Mathematical graphs"); @@ -104,7 +173,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the RandomPolygonsDemo. */ private static class ShowRandomPolygons extends AbstractAction { ShowRandomPolygons() { putValue(NAME, "Random polygons"); @@ -116,7 +184,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the OctreeDemo (volumetric rendering). */ private static class ShowOctree extends AbstractAction { ShowOctree() { putValue(NAME, "Volumetric Octree"); @@ -128,7 +195,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the Game of Life 3D demo. */ private static class ShowGameOfLife extends AbstractAction { ShowGameOfLife() { putValue(NAME, "Game of Life"); @@ -140,10 +206,9 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the ShadedShapesDemo (lighting demonstration). */ private static class ShowShadedShapes extends AbstractAction { ShowShadedShapes() { - putValue(NAME, "Shaded Shapes with Lights"); + putValue(NAME, "Shaded Shapes"); } @Override @@ -152,7 +217,6 @@ class ApplicationListPanel extends JPanel { } } - /** Action to launch the GraphicsBenchmark. */ private static class ShowGraphicsBenchmark extends AbstractAction { ShowGraphicsBenchmark() { putValue(NAME, "Graphics Benchmark"); @@ -163,5 +227,4 @@ class ApplicationListPanel extends JPanel { GraphicsBenchmark.main(null); } } - -} +} \ No newline at end of file diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java index 9f87947..c04d42e 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/Main.java @@ -38,7 +38,9 @@ class Main { frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(new ApplicationListPanel(), CENTER); - frame.setSize(400, 300); + + frame.pack(); + frame.setMinimumSize(frame.getSize()); frame.setLocationRelativeTo(null); // center frame on screen frame.setVisible(true); diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/package-info.java new file mode 100644 index 0000000..560327b --- /dev/null +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/launcher/package-info.java @@ -0,0 +1,15 @@ +/* + * Sixth 3D engine demos. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. + */ + +/** + * Demo launcher application. + * + *

Provides a GUI window with buttons to launch each demo application. + * The main entry point is {@link eu.svjatoslav.sixth.e3d.examples.launcher.Main}.

+ * + * @see eu.svjatoslav.sixth.e3d.examples.launcher.Main + */ + +package eu.svjatoslav.sixth.e3d.examples.launcher; \ No newline at end of file diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/Main.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/Main.java index fd8398b..4258dc7 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/Main.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/Main.java @@ -29,6 +29,12 @@ import java.awt.event.KeyEvent; */ public class Main extends WorldNavigationUserInputTracker { + /** + * Creates a new Main instance for the Game of Life demo. + */ + public Main() { + } + /** The game of life matrix, centered at the origin. */ private static final Matrix MATRIX = new Matrix( new Point3D() // position matrix in the center of the scene diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/package-info.java new file mode 100644 index 0000000..423b24b --- /dev/null +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/life_demo/package-info.java @@ -0,0 +1,23 @@ +/* + * Sixth 3D engine demos. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. + */ + +/** + * Conway's Game of Life 3D demo. + * + *

Implements a 30x30 cell matrix where cells evolve based on Conway's rules. + * Users can interact by clicking to toggle cell states. The simulation runs + * in a 3D view with camera navigation.

+ * + *

Key classes:

+ * + * + * @see eu.svjatoslav.sixth.e3d.examples.life_demo.Main + */ + +package eu.svjatoslav.sixth.e3d.examples.life_demo; \ No newline at end of file