2 * Sixth core user interface. Author: Svjatoslav Agejenko.
3 * This project is released under Creative Commons Zero (CC0) license.
6 package eu.svjatoslav.sixth.core;
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.Avatar;
12 import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
13 import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
14 import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
15 import eu.svjatoslav.sixth.e3d.math.Transform;
16 import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
17 import eu.svjatoslav.sixth.e3d.renderer.raster.ShapeCollection;
18 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance;
19 import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid2D;
24 * Creates nice looking neon grid. Makes it easier to navigate in space.
28 private static Grid2D createGrid() {
29 final Transform location = new Transform(
30 new Point3D(0, 100, 0),
34 return new Grid2D(location,
38 new LineAppearance(10, new Color("00b3ad")));
41 public static void main(final String[] args) {
43 final ViewFrame viewFrame = new ViewFrame();
44 final ViewPanel viewPanel = viewFrame.getViewPanel();
46 final ShapeCollection rootShapeCollection = viewFrame.getViewPanel()
47 .getRootShapeCollection();
49 rootShapeCollection.addShape(createGrid());
50 rootShapeCollection.addShape(createTextEditor(viewPanel));
52 setAvatarStartLocation(viewPanel.getAvatar());
55 private static TextEditComponent createTextEditor(ViewPanel viewPanel) {
56 return new TextEditComponent(
57 new Transform(new Point3D(0, 0, 0)), viewPanel,
58 new Point2D(200, 120));
61 private static void setAvatarStartLocation(Avatar avatar) {
62 avatar.setLocation(new Point3D(500, -300, -800));
63 avatar.setAngleXZ(0.6);
64 avatar.setAngleYZ(-0.5);