<dependency>
<groupId>eu.svjatoslav</groupId>
<artifactId>sixth-3d</artifactId>
- <version>1.1</version>
+ <version>1.2-SNAPSHOT</version>
</dependency>
<dependency>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="FacetManager">
+ <facet type="JRebel" name="JRebel">
+ <configuration>
+ <option name="deleteUnindexed" value="false" />
+ <option name="httpAuthEnabled" value="false" />
+ <option name="httpPassword" />
+ <option name="httpUsername" />
+ <option name="ideModuleStorage">
+ <map>
+ <entry key="com.zeroturnaround.jrebel.FormatVersion" value="7.0.0" />
+ <entry key="com.zeroturnaround.jrebel.remoting.DeleteUnindexedFiles" value="false" />
+ <entry key="com.zeroturnaround.jrebel.remoting.ModuleRemoteServerSelection" value="off" />
+ <entry key="jrebelEnabled" value="true" />
+ </map>
+ </option>
+ <option name="masterModuleName" />
+ <option name="overrideStandardXmlFolder" value="false" />
+ <option name="remotingEnabled" value="false" />
+ <option name="secure" value="true" />
+ <option name="url" />
+ <option name="xmlDir" />
+ </configuration>
+ </facet>
+ </component>
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.1" level="project" />
+ <orderEntry type="module" module-name="sixth-3d" />
+ <orderEntry type="library" scope="TEST" name="Maven: eu.svjatoslav:javainspect:1.5" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: eu.svjatoslav:svjatoslavcommons:1.5" level="project" />
+ </component>
+</module>
\ No newline at end of file
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
+++ /dev/null
-/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- */
-
-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.renderer.raster.Color;
-import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
-import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
-import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon.SolidPolygon;
-import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D;
-
-class GridSpace {
-
- private static void addRandomPolygon(final ShapeCollection geometryCollection) {
- final Point3D polygonLocation = getRandomPoint(1000);
-
- final double polygonAverageSize = 30;
-
- final Point3D point1 = new Point3D(polygonLocation);
- point1.add(getRandomPoint(polygonAverageSize));
-
- final Point3D point2 = new Point3D(polygonLocation);
- point2.add(getRandomPoint(polygonAverageSize));
-
- final Point3D point3 = new Point3D(polygonLocation);
- point3.add(getRandomPoint(polygonAverageSize));
-
- final Color color = new Color(Math.random(), Math.random(),
- Math.random(), 0.5d);
-
- final SolidPolygon polygon = new SolidPolygon(point1, point2, point3,
- color);
- geometryCollection.addShape(polygon);
- }
-
- private static Point3D getRandomPoint(final double amplitude) {
- return new Point3D((Math.random() * amplitude * 2d) - amplitude,
- (Math.random() * amplitude * 2d) - amplitude, (Math.random()
- * amplitude * 2d)
- - amplitude);
- }
-
- public static void main(final String[] args) {
-
- final ViewFrame viewFrame = new ViewFrame();
-
- final ShapeCollection shapeCollection = viewFrame.getView()
- .getContext().getRootShapeCollection();
-
- // add grid
- final LineAppearance appearance = new LineAppearance(5, new Color(100,
- 100, 255, 60));
-
- shapeCollection.addShape(new Grid3D(new Point3D(1000, -1000, -1000),
- new Point3D(-1000, 1000, 1000), 300, appearance));
-
- // add random polygons
- for (int i = 0; i < 3000; i++)
- addRandomPolygon(shapeCollection);
-
- }
-}
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D;
import java.awt.event.KeyEvent;
-import java.io.IOException;
import java.util.Vector;
public class OctreeDemo extends WorldNavigationTracker {
private ShapeCollection shapeCollection;
private ViewContext context;
- public static void main(final String[] args) throws IOException {
+ public static void main(final String[] args) {
new OctreeDemo().init();
}
}
}
- private void init() throws IOException {
+ private void init() {
final ViewFrame viewFrame = new ViewFrame();
context = viewFrame.getView().getContext();
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
--- /dev/null
+/*
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+ */
+
+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.renderer.raster.Color;
+import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
+import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
+import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon.SolidPolygon;
+import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D;
+
+public class RandomPolygonsDemo {
+
+ private static void addRandomPolygon(final ShapeCollection geometryCollection) {
+ final Point3D polygonLocation = getRandomPoint(1000);
+
+ final double polygonAverageSize = 30;
+
+ final Point3D point1 = new Point3D(polygonLocation);
+ point1.add(getRandomPoint(polygonAverageSize));
+
+ final Point3D point2 = new Point3D(polygonLocation);
+ point2.add(getRandomPoint(polygonAverageSize));
+
+ final Point3D point3 = new Point3D(polygonLocation);
+ point3.add(getRandomPoint(polygonAverageSize));
+
+ final Color color = new Color(Math.random(), Math.random(),
+ Math.random(), 0.5d);
+
+ final SolidPolygon polygon = new SolidPolygon(point1, point2, point3,
+ color);
+ geometryCollection.addShape(polygon);
+ }
+
+ private static Point3D getRandomPoint(final double amplitude) {
+ return new Point3D((Math.random() * amplitude * 2d) - amplitude,
+ (Math.random() * amplitude * 2d) - amplitude, (Math.random()
+ * amplitude * 2d)
+ - amplitude);
+ }
+
+ public static void main(final String[] args) {
+
+ final ViewFrame viewFrame = new ViewFrame();
+
+ final ShapeCollection shapeCollection = viewFrame.getView()
+ .getContext().getRootShapeCollection();
+
+ // add grid
+ final LineAppearance appearance = new LineAppearance(5, new Color(100,
+ 100, 255, 60));
+
+ shapeCollection.addShape(new Grid3D(new Point3D(1000, -1000, -1000),
+ new Point3D(-1000, 1000, 1000), 300, appearance));
+
+ // add random polygons
+ for (int i = 0; i < 3000; i++)
+ addRandomPolygon(shapeCollection);
+
+ }
+}
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
private Main() {
super();
initGUI();
-
}
- /**
- * Auto-generated main method to display this JFrame
- */
public static void main(final String[] args) {
SwingUtilities.invokeLater(() -> {
final Main inst = new Main();
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License
class MenuPanel extends JPanel {
private static final long serialVersionUID = 2012721856427052560L;
- public MenuPanel() {
-
+ MenuPanel() {
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 ShowSinusMap()));
sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
sequentialGroup.addComponent(new JButton(new ShowGameOfLife()));
+ sequentialGroup.addComponent(new JButton(new ShowRandomPolygons()));
}
private class ShowTextEditors extends AbstractAction {
- public ShowTextEditors() {
+ ShowTextEditors() {
putValue(NAME, "Text editors");
}
}
}
+ private class ShowRandomPolygons extends AbstractAction {
+ public ShowRandomPolygons() {
+ putValue(NAME, "Random polygons");
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ RandomPolygonsDemo.main(null);
+ }
+ }
+
private class ShowOctree extends AbstractAction {
public ShowOctree() {
putValue(NAME, "Volumetric Octree");
@Override
public void actionPerformed(final ActionEvent e) {
- try {
- OctreeDemo.main(null);
- } catch (final IOException e1) {
- e1.printStackTrace();
- }
+ OctreeDemo.main(null);
}
}
import java.util.ArrayList;
import java.util.List;
-public class Star extends GlowingPoint{
+public class Star extends GlowingPoint {
public static final int STAR_SIZE = 10;
public static final int UNIQUE_STARS_COUNT = 30;
/*
- * Sixth 3D engine demos. Copyright ©2012-2016, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public License