Skip to content
Snippets Groups Projects
Commit 11120822 authored by MasterPyo's avatar MasterPyo
Browse files

camera, small fixes

parent d6bbacdf
Branches
No related merge requests found
......@@ -23,7 +23,7 @@ public class Main extends Application {
stage.setTitle("Chess3D - Tuna Acikbas & Olivier Pillods"); // title
// init - camera
CustomCamera camera = new CustomCamera(1, 600, 70); // create a camera and some settings
CustomCamera camera = new CustomCamera(1, 1000, 70); // create a camera and some settings
// init - scene, main container
Group group = new Group(); // will contain all the elements "to show" on scene
......
......@@ -77,7 +77,7 @@ public class CustomCamera {
public void scrollCamera(double deltaY) {
double z = camera.getTranslateZ();
if(deltaY > 0) {
if(z < -100)
if(z < 30)
camera.setTranslateZ(z + SCROLL_SPEED);
}
else {
......
......@@ -9,7 +9,7 @@ import javafx.scene.paint.Color;
public class CustomScene {
private Scene scene;
public CustomScene(Group group, PerspectiveCamera camera, SceneAntialiasing antialiasing) {
scene = new Scene(group, 1, 1, true, antialiasing); // create scene
scene = new Scene(group, 800, 500, true, antialiasing); // create scene
scene.setFill(Color.rgb(50, 50, 50)); // background default color
scene.setCamera(camera); // link camera to scene
}
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment