Made seasurface overlay to enable skybox to be smaller. #story[1261]
This commit is contained in:
@@ -8,8 +8,11 @@ import javafx.collections.ListChangeListener;
|
|||||||
import javafx.collections.ObservableList;
|
import javafx.collections.ObservableList;
|
||||||
import javafx.collections.transformation.SortedList;
|
import javafx.collections.transformation.SortedList;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.AmbientLight;
|
||||||
|
import javafx.scene.PointLight;
|
||||||
import javafx.scene.chart.LineChart;
|
import javafx.scene.chart.LineChart;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
|
import javafx.scene.effect.Light;
|
||||||
import javafx.scene.input.KeyCode;
|
import javafx.scene.input.KeyCode;
|
||||||
import javafx.scene.input.KeyEvent;
|
import javafx.scene.input.KeyEvent;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
@@ -205,10 +208,10 @@ public class RaceController extends Controller {
|
|||||||
//viewSubjects.add(new Subject3D(new MeshView(new Plane3D(50, 50, 1, 1))));
|
//viewSubjects.add(new Subject3D(new MeshView(new Plane3D(50, 50, 1, 1))));
|
||||||
|
|
||||||
|
|
||||||
SeaSurface sea = new SeaSurface(4000, 200, 250, 210);
|
SeaSurface sea = new SeaSurface(750, 200, 250, 0, 210);
|
||||||
SkyBox skyBox = new SkyBox(500, 200, 250, 0, 210);
|
SkyBox skyBox = new SkyBox(750, 200, 250, 0, 210);
|
||||||
|
viewSubjects.add(sea.getSurface());
|
||||||
viewSubjects.addAll(skyBox.getSkyBoxPlanes());
|
viewSubjects.addAll(skyBox.getSkyBoxPlanes());
|
||||||
//viewSubjects.add(sea.getSurface());
|
|
||||||
|
|
||||||
Boundary3D boundary3D = new Boundary3D(visualiserRace.getVisualiserRaceState().getRaceDataSource().getBoundary(), gpsConverter);
|
Boundary3D boundary3D = new Boundary3D(visualiserRace.getVisualiserRaceState().getRaceDataSource().getBoundary(), gpsConverter);
|
||||||
for (Subject3D subject3D: boundary3D.getBoundaryNodes()){
|
for (Subject3D subject3D: boundary3D.getBoundaryNodes()){
|
||||||
|
|||||||
@@ -26,10 +26,11 @@ public class SeaSurface {
|
|||||||
* @param x offset that the sea should be set at position-wise
|
* @param x offset that the sea should be set at position-wise
|
||||||
* @param z offset that the sea should be set at position-wise
|
* @param z offset that the sea should be set at position-wise
|
||||||
*/
|
*/
|
||||||
public SeaSurface(int size, double freq, double x, double z){
|
public SeaSurface(int size, double freq, double x, double y, double z){
|
||||||
noiseArray = PerlinNoiseGenerator.createNoise(size, freq);
|
noiseArray = PerlinNoiseGenerator.createNoise(size, freq);
|
||||||
createSurface();
|
createSurface();
|
||||||
surface.setZ(z);
|
surface.setZ(z);
|
||||||
|
surface.setY(y);
|
||||||
surface.setX(x);
|
surface.setX(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,11 +33,12 @@ public class SkyBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void makeSkyBox() {
|
private void makeSkyBox() {
|
||||||
addTop();
|
//addTop();
|
||||||
addFront();
|
addFront();
|
||||||
addBack();
|
addBack();
|
||||||
addLeft();
|
addLeft();
|
||||||
addRight();
|
addRight();
|
||||||
|
addSeaOverlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addTop() {
|
private void addTop() {
|
||||||
@@ -142,6 +143,11 @@ public class SkyBox {
|
|||||||
return surface;
|
return surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addSeaOverlay() {
|
||||||
|
SeaSurface seaSurface = new SeaSurface(size * 3, 200, x, y - size/4 + 1, z);
|
||||||
|
skyBoxPlanes.add(seaSurface.getSurface());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create texture for uv mapping
|
* Create texture for uv mapping
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ public class View3D extends Pane {
|
|||||||
target.getHeading().angleProperty().addListener(pivotHeading);
|
target.getHeading().angleProperty().addListener(pivotHeading);
|
||||||
|
|
||||||
this.setDistance(THIRD_PERSON_LIMIT);
|
this.setDistance(THIRD_PERSON_LIMIT);
|
||||||
this.setPitch(20);
|
this.setPitch(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNearClip(double nearClip) {
|
public void setNearClip(double nearClip) {
|
||||||
|
|||||||
Reference in New Issue
Block a user