Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified out/production/3D_Demo/Launcher.class
Binary file not shown.
1 change: 1 addition & 0 deletions src/Launcher.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public class Launcher {
public static void main(String[] args) {
System.out.println("Hello World");
Main main = new Main();
}
}
36 changes: 36 additions & 0 deletions src/Main.java
Original file line number Diff line number Diff line change
@@ -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){


}
}
32 changes: 32 additions & 0 deletions src/Object/Polygone.java
Original file line number Diff line number Diff line change
@@ -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){

}
}
15 changes: 15 additions & 0 deletions src/Object/Vector.java
Original file line number Diff line number Diff line change
@@ -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));
}
}
32 changes: 32 additions & 0 deletions src/WindowMannaging/Window.java
Original file line number Diff line number Diff line change
@@ -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;
}
}