diff --git a/out/production/3D_Demo/Launcher.class b/out/production/3D_Demo/Launcher.class index 3027462..45b9cfe 100644 Binary files a/out/production/3D_Demo/Launcher.class and b/out/production/3D_Demo/Launcher.class differ diff --git a/src/Launcher.java b/src/Launcher.java index 17df93c..e343c60 100644 --- a/src/Launcher.java +++ b/src/Launcher.java @@ -1,5 +1,6 @@ public class Launcher { public static void main(String[] args) { System.out.println("Hello World"); + Main main = new Main(); } } diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000..5358329 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,36 @@ +import WindowMannaging.Window; + +import java.awt.*; +import java.awt.image.BufferStrategy; + +public class Main { + ///////////////////////////////// + private static final int WIDTH = 1000; + private static final int HEIGHT = 700; + Window window; + Graphics g; + BufferStrategy bs; + ////////////////////////////////// Class attributes + public Main (){ + window = new Window(WIDTH,HEIGHT,"3D-Game"); + init(); + } + + private void init(){ + bs = window.getCanvas().getBufferStrategy(); + if(window.getCanvas().getBufferStrategy() == null){ + window.getCanvas().createBufferStrategy(3); + return; + } + g = bs.getDrawGraphics(); + g.clearRect(0,0, window.getWidth(), window.getHeight()); + render(g); + } + + public void tick(){} + + public void render(Graphics g){ + + + } +} diff --git a/src/Object/Polygone.java b/src/Object/Polygone.java new file mode 100644 index 0000000..0b96b88 --- /dev/null +++ b/src/Object/Polygone.java @@ -0,0 +1,32 @@ +package Object; + +import java.awt.*; + +/** + * Ein Quader object + */ +public class Polygone { + ////////////////////////// + Dimension startpoint; + int length; + int height; + int depth; + ////////////////////////// Class attributes + + /** + * + * @param startpoint der Obere linke punkt des Quaders + * @param length die Länge des Quaders + * @param height die Höhe des Quaders + * @param depth die Tiefe des Quaders + */ + public Polygone(Dimension startpoint , int length, int height, int depth){ + this.startpoint = startpoint; + this.length = length; + this.height = height; + this.depth = depth; + } + public void render(Graphics g){ + + } +} diff --git a/src/Object/Vector.java b/src/Object/Vector.java new file mode 100644 index 0000000..eb0fc32 --- /dev/null +++ b/src/Object/Vector.java @@ -0,0 +1,15 @@ +package Object; + +import java.awt.*; + +public class Vector { + double x,y,z; + public Vector(double x,double y,double z){ + this.x = x; + this.y = y; + this.z = z; + } + public Point convertTo2D(Vector v){ + return new Point((int)(500+y),(int)(350+z)); + } +} diff --git a/src/WindowMannaging/Window.java b/src/WindowMannaging/Window.java new file mode 100644 index 0000000..dccf954 --- /dev/null +++ b/src/WindowMannaging/Window.java @@ -0,0 +1,32 @@ +package WindowMannaging; +import javax.swing.*; +import java.awt.*; +public class Window extends JFrame { + Canvas canvas; + /** + * + * @param length the Length of the Window + * @param height The Height of the Window + * @param WindowLable the Name of the Window + */ + public Window(int length , int height,String WindowLable){ + super(WindowLable); + this.setSize(length,height); + this.setDefaultCloseOperation(EXIT_ON_CLOSE); + this.setLocationRelativeTo(null); + this.setVisible(true); + canvas.setSize(length,height); + this.add(canvas); + } + /** + * + * @param comp an + */ + public void addPane(Component comp){ + this.add(comp); + } + + public Canvas getCanvas(){ + return canvas; + } +}