Three-dimensional cube rotation and scaling using JavaFX library. Rotation implies showing only visible side of cube.
Java version 23.0.1
JavaFX version 23.0.1
-
Download latest JDK and install it (adding variables to PATH).
-
Make sure you have javac.exe compiler
C:\Users\USER\.jdks\jdk-{version}\bin\javac.exe
-
Download latest JavaFx library and extract contents whereever it is reachable.
-
To compile, open command line in source code directory and write
javac.exe --module-path {Path to your javafx lib folder} --add-modules=javafx.controls Main.java
- For example if JavaFx contents extracted to
С:\Java
Then command should look like this:
javac.exe --module-path "C:\Java\javafx-sdk-23.0.1\lib" --add-modules=javafx.controls Main.java
- If you have problems with javac.exe, try to write absolute path to javac.exe (see p.2)
- For example if JavaFx contents extracted to
-
After compilation run
Main
file:
java --module-path {Path to your javafx lib folder} --add-modules=javafx.controls Main
-
Run
sudo apt update
andsudo apt upgrade
-
Download latest JDK for your Linux system and install it.
-
Download latest JavaFx library and extract contents whereever it is reachable.
-
To compile, open command line in source code directory and write
javac --module-path {Path to your javafx lib folder} --add-modules=javafx.controls Main.java
- For example if JavaFx contents extracted to
home/USER/Java
Then command should look like this:
javac --module-path "home/USER/Java/javafx-sdk-23.0.1/lib" --add-modules=javafx.controls Main.java
- For example if JavaFx contents extracted to
-
After compilation run
Main
file:
java --module-path {Path to your javafx lib folder} --add-modules=javafx.controls Main
After successful compilation just enter X, Y, Z degree and, if you want, change scale of cube. To confirm and see the result of entered values just press "Enter!" button.
After pressing the button you will see projection of three-dimensional cube.