c3239328e80d506d5b286b491aab2de31a76f40c
[sixth.git] / src / main / java / eu / svjatoslav / sixth / core / Main.java
1 /*
2  * Sixth core user interface. Author: Svjatoslav Agejenko.
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5
6 package eu.svjatoslav.sixth.core;
7
8 import eu.svjatoslav.sixth.e3d.geometry.Point2D;
9 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
10 import eu.svjatoslav.sixth.e3d.geometry.Rectangle;
11 import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
12 import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
13 import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
14 import eu.svjatoslav.sixth.e3d.math.Transform;
15 import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
16 import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
17 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
18 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid2D;
19
20 public class Main {
21
22     private static Grid2D createGrid() {
23         final Transform location = new Transform(
24                 new Point3D(0, 100, 0),
25                 0,
26                 Math.PI / 2);
27
28         return new Grid2D(location,
29                 new Rectangle(2000),
30                 10,
31                 10,
32                 new LineAppearance(10, new Color("00b3ad")));
33     }
34
35     public static void main(final String[] args) {
36
37         final ViewFrame viewFrame = new ViewFrame();
38         final ViewPanel viewPanel = viewFrame.getViewPanel();
39
40         final ShapeCollection shapeCollection = viewFrame.getViewPanel()
41                 .getRootShapeCollection();
42
43         shapeCollection.addShape(createGrid());
44
45
46         final TextEditComponent textEditor = new TextEditComponent(
47                 new Transform(new Point3D(0, 0, 0)), viewPanel,
48                 new Point2D(200, 120));
49
50         shapeCollection.addShape(textEditor);
51
52         viewPanel.getAvatar().setLocation(new Point3D(500, -300, -800));
53         viewPanel.getAvatar().setAngleXZ(0.6);
54         viewPanel.getAvatar().setAngleYZ(-0.5);
55
56     }
57 }