Updated wind arrow 3D model

#story[1276]
This commit is contained in:
Zhi You Tan
2017-09-28 11:02:47 +13:00
parent 72fe8c4881
commit 567e351c7f
6 changed files with 363 additions and 6 deletions
@@ -2,7 +2,11 @@ package seng302.visualiser.controllers.cells;
import javafx.fxml.FXML;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.layout.Pane;
import seng302.visualiser.cameras.ChaseCamera;
import seng302.visualiser.cameras.IsometricCamera;
import seng302.visualiser.cameras.TopDownCamera;
import seng302.visualiser.fxObjects.assets_3D.Model;
import seng302.visualiser.fxObjects.assets_3D.ModelFactory;
@@ -13,6 +17,15 @@ public class WindCell {
private Pane windPane;
//---------FXML END---------//
private final double FOV = 60;
private final double DEFAULT_CAMERA_X = 0;
private final double DEFAULT_CAMERA_Y = 155;
// Cameras
private PerspectiveCamera isometricCam;
private PerspectiveCamera topDownCam;
private PerspectiveCamera chaseCam;
/**
* Initialise WindCell fxml and load 3D wind arrow into a group.
*/
@@ -21,5 +34,11 @@ public class WindCell {
windPane.getChildren().add(group);
Model windArrowModel = ModelFactory.makeWindArrow();
group.getChildren().add(windArrowModel.getAssets());
isometricCam = new IsometricCamera(DEFAULT_CAMERA_X, DEFAULT_CAMERA_Y);
topDownCam = new TopDownCamera();
chaseCam = new ChaseCamera();
}
}
@@ -285,8 +285,8 @@ public class ModelFactory {
Rotate animationRotate = new Rotate(0, new Point3D(0, 1, 0));
assets.getTransforms().addAll(
new Scale(6, 6, 6),
new Translate(7, 10, 0),
new Translate(55, 60, 0),
new Scale(5, 5, 5),
animationRotate
);
@@ -27,7 +27,7 @@ public enum ModelType {
PLAIN_ARROW ("arrow.dae"),
START_ARROW ("start_arrow.dae"),
FINISH_ARROW("finish_arrow.dae"),
WIND_ARROW("windFiles/log_arrow.dae");
WIND_ARROW("windFiles/arrow56.dae"); // change filename
final String filename;
@@ -0,0 +1,3 @@
#windPane {
-fx-background-color: rgba(255, 255, 255, 0);
}
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.Pane?>
<Pane fx:id="windPane" prefHeight="120.0" prefWidth="110.0" xmlns="http://javafx.com/javafx/8.0.111"
<Pane fx:id="windPane" prefHeight="120.0" prefWidth="110.0"
stylesheets="@../../css/cells/WindCell.css" xmlns="http://javafx.com/javafx/8"
xmlns:fx="http://javafx.com/fxml/1"/>