private static final double scale = 50d;
- private static Graph getCosineGraph(final Point3D location)
- throws IOException {
+ private static Graph getCosineGraph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.cos(x);
return new Graph(scale, data, "Cosine", location);
}
- private static Graph getFormula1Graph(final Point3D location)
- throws IOException {
+ private static Graph getFormula1Graph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(Math.tan(x));
return new Graph(scale, data, "y = ( (10-x)^2 ) / 30", location);
}
- private static Graph getFormula3Graph(final Point3D location)
- throws IOException {
+ private static Graph getFormula3Graph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(x / 2) + Math.sin(x / 1.26);
return new Graph(scale, data, "y = sin(x/2) + sin(x/1.26)", location);
}
- private static Graph getSineGraph(final Point3D location)
- throws IOException {
+ private static Graph getSineGraph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
final double y = Math.sin(x);
return new Graph(scale, data, "Sine", location);
}
- private static Graph getTangentGraph(final Point3D location)
- throws IOException {
+ private static Graph getTangentGraph(final Point3D location) {
final List<Point2D> data = new ArrayList<>();
for (double x = 0; x < 20; x += 0.25) {
double y = Math.tan(x);
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationTracker;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.octree.OctreeVolume;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Camera;
import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.LightSource;
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.Galaxy;
package eu.svjatoslav.sixth.e3d.examples;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.ViewRenderListener;
+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.AbstractShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas.TextCanvas;
-import java.io.IOException;
import java.util.Collection;
import java.util.Random;
private final static int AREA = 600;
private final static int AREA_HALF = AREA / 2;
- public static void main(final String[] args) throws IOException {
+ public static void main(final String[] args) {
new RainingNumbersDemo().run();
}
}
/* I don't want very dark polygons, so ensure there is at least some
- * brightness present. */
+ * brightness present. */
private static double getColorChannelBrightness() {
return Math.random() * 0.7 + 0.3f;
}
import eu.svjatoslav.sixth.e3d.geometry.Point2D;
import eu.svjatoslav.sixth.e3d.geometry.Point3D;
import eu.svjatoslav.sixth.e3d.geometry.Rectangle;
-import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
-import eu.svjatoslav.sixth.e3d.math.Transform;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
+import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
+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.basic.line.LineAppearance;
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 ShowPointCloud()));
sequentialGroup.addComponent(new JButton(new ShowRain()));
sequentialGroup.addComponent(new JButton(new ShowSinusMap()));
sequentialGroup.addComponent(new JButton(new ShowTextEditors()));
}
private class ShowSinusMap extends AbstractAction {
- public ShowSinusMap() {
+ ShowSinusMap() {
putValue(NAME, "Wireframe sphere and ploygon landscape");
}
}
private class ShowRain extends AbstractAction {
- public ShowRain() {
+ ShowRain() {
putValue(NAME, "Raining numbers");
}
@Override
public void actionPerformed(final ActionEvent e) {
- try {
- RainingNumbersDemo.main(null);
- } catch (final IOException e1) {
- e1.printStackTrace();
- }
+ RainingNumbersDemo.main(null);
}
}
- private class ShowPointcloud extends AbstractAction {
- public ShowPointcloud() {
+ private class ShowPointCloud extends AbstractAction {
+ ShowPointCloud() {
putValue(NAME, "Pointcloud galaxy");
}
}
private class ShowMathGraphs extends AbstractAction {
- public ShowMathGraphs() {
+ ShowMathGraphs() {
putValue(NAME, "Mathematical graphs");
}
}
private class ShowRandomPolygons extends AbstractAction {
- public ShowRandomPolygons() {
+ ShowRandomPolygons() {
putValue(NAME, "Random polygons");
}
}
private class ShowOctree extends AbstractAction {
- public ShowOctree() {
+ ShowOctree() {
putValue(NAME, "Volumetric Octree");
}
}
private class ShowGameOfLife extends AbstractAction {
- public ShowGameOfLife() {
+ ShowGameOfLife() {
putValue(NAME, "Game of Life");
}
/**
* This class corresponds to a single cell within matrix.
*/
-public class Cell extends AbstractCompositeShape implements
+class Cell extends AbstractCompositeShape implements
MouseInteractionController {
/**
import java.util.ArrayList;
import java.util.List;
-public class Star extends GlowingPoint {
+class Star extends GlowingPoint {
public static final int STAR_SIZE = 10;
public static final int UNIQUE_STARS_COUNT = 30;