List of commits:
Subject Hash Author Date (UTC)
initial Commit e69430bfab98d7aa5f068b4324fd27f86c996fc8 sven 2019-03-01 17:42:02
Commit e69430bfab98d7aa5f068b4324fd27f86c996fc8 - initial Commit
Author: sven
Author date (UTC): 2019-03-01 17:42
Committer name: sven
Committer date (UTC): 2019-03-01 17:42
Parent(s):
Signing key:
Tree: bd8f8891bbde2a1e4957ae0bf89ae02c73bd09a4
File Lines added Lines deleted
src/data/Math.java 7 0
src/data/Vector.java 7 0
src/ui/Controller.java 51 0
src/ui/Main.java 44 0
src/ui/sample.fxml 27 0
File src/data/Math.java added (mode: 100644) (index 0000000..40aa927)
1 package data;
2
3 public class Math {
4 public float[][] getRotationMatrix(float angle, int dimensions, int axis){
5 return new float[0][0];
6 }
7 }
File src/data/Vector.java added (mode: 100644) (index 0000000..797e222)
1 package data;
2
3 public class Vector {
4 public int get(int index){
5 return 0;
6 }
7 }
File src/ui/Controller.java added (mode: 100644) (index 0000000..f1b0869)
1 package ui;
2
3 import javafx.fxml.FXML;
4 import javafx.scene.canvas.Canvas;
5 import javafx.scene.canvas.GraphicsContext;
6
7 import data.Vector;
8 import javafx.scene.control.CheckBox;
9 import javafx.scene.control.Slider;
10 import javafx.scene.paint.Color;
11 import javafx.scene.paint.Paint;
12
13 public class Controller {
14 private int WIDTH,HEIGHT;
15 private GraphicsContext gc;
16 @FXML
17 private Canvas canvasDraw;
18 @FXML
19 private Slider sliderX,sliderY,sliderZ;
20 @FXML
21 private CheckBox cBRotate;
22
23 @FXML
24 private void initialize(){
25 gc = canvasDraw.getGraphicsContext2D();
26 WIDTH=(int)Math.round(canvasDraw.getWidth());
27 HEIGHT=(int)Math.round(canvasDraw.getHeight());
28 }
29
30 public void simulate(){
31 gc.setFill(Color.GRAY);
32 gc.fillRect(0, 0, 600, 600);
33 gc.setFill(Color.WHITE);
34 gc.fillOval(WIDTH / 2, HEIGHT / 2, 10, 10);
35
36 }
37
38 private void drawPoint( Vector v){
39 gc.fillOval(v.get(0),v.get(1),5,5);
40 }
41 private void connect( Vector v1 , Vector v2){
42 gc.strokeLine(v1.get(0),v1.get(1),v2.get(0),v2.get(1));
43 }
44
45 public class Draw implements Runnable{
46 @Override
47 public void run() {
48 simulate();
49 }
50 }
51 }
File src/ui/Main.java added (mode: 100644) (index 0000000..38e2d6c)
1 package ui;
2
3 import javafx.application.Application;
4 import javafx.application.Platform;
5 import javafx.event.EventHandler;
6 import javafx.fxml.FXMLLoader;
7 import javafx.scene.Parent;
8 import javafx.scene.Scene;
9 import javafx.stage.Stage;
10 import javafx.stage.WindowEvent;
11
12 import java.util.Timer;
13 import java.util.TimerTask;
14
15 public class Main extends Application {
16
17 @Override
18 public void start(Stage primaryStage) throws Exception{
19 FXMLLoader loader =new FXMLLoader(getClass().getResource("sample.fxml"));
20 Parent root = loader.load();
21 Controller c = loader.getController();
22 primaryStage.setTitle("3D-Simulation");
23 primaryStage.setScene(new Scene(root));
24 primaryStage.show();
25 Timer t = new Timer();
26 t.scheduleAtFixedRate(new TimerTask() {
27 @Override
28 public void run() {
29 Platform.runLater(c.new Draw());
30 }
31 },0,10);
32 primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
33 @Override
34 public void handle(WindowEvent event) {
35 t.cancel();
36 }
37 });
38 }
39
40
41 public static void main(String[] args) {
42 launch(args);
43 }
44 }
File src/ui/sample.fxml added (mode: 100644) (index 0000000..62eb299)
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <?import javafx.scene.canvas.Canvas?>
4 <?import javafx.scene.control.CheckBox?>
5 <?import javafx.scene.control.Label?>
6 <?import javafx.scene.control.Slider?>
7 <?import javafx.scene.control.SplitPane?>
8 <?import javafx.scene.layout.AnchorPane?>
9
10 <SplitPane dividerPositions="0.25" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ui.Controller">
11 <items>
12 <AnchorPane maxHeight="600.0" maxWidth="200.0" minHeight="600.0" minWidth="200.0" prefHeight="600.0" prefWidth="200.0">
13 <children>
14 <Slider fx:id="sliderX" layoutX="14.0" layoutY="37.0" />
15 <Label layoutX="14.0" layoutY="14.0" text="X-Achse:" />
16 <Slider fx:id="sliderY" layoutX="14.0" layoutY="96.0" />
17 <Label layoutX="14.0" layoutY="73.0" text="Y-Achse:" />
18 <Slider fx:id="sliderZ" layoutX="14.0" layoutY="160.0" />
19 <Label layoutX="14.0" layoutY="137.0" text="Z-Achse:" />
20 <CheckBox fx:id="cBRotate" layoutX="14.0" layoutY="203.0" mnemonicParsing="false" text="Rotieren" />
21 </children></AnchorPane>
22 <AnchorPane maxHeight="600.0" maxWidth="600.0" minHeight="600.0" minWidth="600.0" prefHeight="600.0" prefWidth="600.0">
23 <children>
24 <Canvas fx:id="canvasDraw" height="600.0" layoutX="213.0" layoutY="154.0" width="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
25 </children></AnchorPane>
26 </items>
27 </SplitPane>
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/SF2311/Rotation

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/SF2311/Rotation

Clone this repository using git:
git clone git://git.rocketgit.com/user/SF2311/Rotation

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main