Added lights and managed to get the orientation of one of the skybox walls correct. #story[1261]

This commit is contained in:
Joseph Gardner
2017-09-12 18:16:08 +12:00
parent 7a8ea7fea7
commit bcc827b554
4 changed files with 46 additions and 92 deletions
@@ -17,6 +17,7 @@ import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.MeshView;
import javafx.scene.transform.Translate;
import javafx.util.Callback;
@@ -177,6 +178,16 @@ public class RaceController extends Controller {
private void initialiseView3D(VisualiserRaceEvent race) {
viewSubjects = FXCollections.observableArrayList();
AmbientLight ambientLight = new AmbientLight(new Color(1, 1, 1, 0.75));
ambientLight.setTranslateX(250);
ambientLight.setTranslateZ(210);
ambientLight.setLightOn(true);
PointLight pointLight = new PointLight();
ambientLight.setTranslateX(250);
ambientLight.setTranslateZ(210);
ambientLight.setLightOn(true);
// Import boat mesh
URL asset = HostController.class.getClassLoader().getResource("assets/V1.2 Complete Boat.stl");
StlMeshImporter importer = new StlMeshImporter();
@@ -197,6 +208,8 @@ public class RaceController extends Controller {
view3D.setYaw(0);
view3D.setPitch(60);
view3D.enableTracking();
view3D.addAmbientLight(ambientLight);
view3D.addPointLight(pointLight);
canvasBase.add(view3D, 0, 0);
// Set up projection from GPS to view