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.Avatar;
import eu.svjatoslav.sixth.e3d.gui.ViewFrame;
import eu.svjatoslav.sixth.e3d.gui.ViewPanel;
import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.TextEditComponent;
public class Main {
+ /**
+ * Creates nice looking neon grid. Makes it easier to navigate in space.
+ *
+ * @return grid
+ */
private static Grid2D createGrid() {
final Transform location = new Transform(
new Point3D(0, 100, 0),
final ViewFrame viewFrame = new ViewFrame();
final ViewPanel viewPanel = viewFrame.getViewPanel();
- final ShapeCollection shapeCollection = viewFrame.getViewPanel()
+ final ShapeCollection rootShapeCollection = viewFrame.getViewPanel()
.getRootShapeCollection();
- shapeCollection.addShape(createGrid());
+ rootShapeCollection.addShape(createGrid());
+ rootShapeCollection.addShape(createTextEditor(viewPanel));
+ setAvatarStartLocation(viewPanel.getAvatar());
+ }
- final TextEditComponent textEditor = new TextEditComponent(
- new Transform(new Point3D(0, 0, 0)), viewPanel,
- new Point2D(200, 120));
-
- shapeCollection.addShape(textEditor);
-
- viewPanel.getAvatar().setLocation(new Point3D(500, -300, -800));
- viewPanel.getAvatar().setAngleXZ(0.6);
- viewPanel.getAvatar().setAngleYZ(-0.5);
+ private static TextEditComponent createTextEditor(ViewPanel viewPanel) {
+ return new TextEditComponent(
+ new Transform(new Point3D(0, 0, 0)), viewPanel,
+ new Point2D(200, 120));
+ }
+ private static void setAvatarStartLocation(Avatar avatar) {
+ avatar.setLocation(new Point3D(500, -300, -800));
+ avatar.setAngleXZ(0.6);
+ avatar.setAngleYZ(-0.5);
}
}