X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2FGraphDemo.java;h=5e2009d7578955bc0c8d9a2fee203570633b5256;hp=2bbd237d8d9ff0bcf5f0c2f8a060d23f728fee8c;hb=04e601452e1e31d14f13b50c1fce9cc6081a8bf2;hpb=ee85b7fbac8b2f5e329b7fa590a0dcf7691a1084 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 2bbd237..5e2009d 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java @@ -1,5 +1,5 @@ /* - * 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 @@ -22,7 +22,7 @@ public class GraphDemo { private static final double scale = 50d; - private static Graph getCosinusGraph(final Point3D location) + private static Graph getCosineGraph(final Point3D location) throws IOException { final List data = new ArrayList<>(); for (double x = 0; x < 20; x += 0.25) { @@ -32,7 +32,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "Cosinus", location); + return new Graph(scale, data, "Cosine", location); } private static Graph getFormula1Graph(final Point3D location) @@ -74,7 +74,7 @@ public class GraphDemo { return new Graph(scale, data, "y = sin(x/2) + sin(x/1.26)", location); } - private static Graph getSinusGraph(final Point3D location) + private static Graph getSineGraph(final Point3D location) throws IOException { final List data = new ArrayList<>(); for (double x = 0; x < 20; x += 0.25) { @@ -84,7 +84,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "Sinus", location); + return new Graph(scale, data, "Sine", location); } private static Graph getTangentGraph(final Point3D location) @@ -109,17 +109,17 @@ public class GraphDemo { final ViewFrame viewFrame = new ViewFrame(); - final ShapeCollection geometryCollection = viewFrame.getView() - .getContext().getRootShapeCollection(); + final ShapeCollection geometryCollection = viewFrame.getViewPanel() + .getRootShapeCollection(); Point3D location = new Point3D(-600, -300, 0); - geometryCollection.addShape(getSinusGraph(location)); + geometryCollection.addShape(getSineGraph(location)); location = new Point3D(600, -300, 0); geometryCollection.addShape(getFormula1Graph(location)); location = new Point3D(-600, 0, 0); - geometryCollection.addShape(getCosinusGraph(location)); + geometryCollection.addShape(getCosineGraph(location)); location = new Point3D(600, 0, 0); geometryCollection.addShape(getFormula2Graph(location)); @@ -130,7 +130,7 @@ public class GraphDemo { location = new Point3D(600, 300, 0); geometryCollection.addShape(getFormula3Graph(location)); - viewFrame.getView().getContext().getAvatar() + viewFrame.getViewPanel().getAvatar() .setLocation(new Point3D(0, 0, -500)); }