# Conflicts: # racevisionGame/src/main/resources/visualiser/scenes/hostlobby.fxmlmain
commit
b724a814b1
@ -0,0 +1,18 @@
|
|||||||
|
package visualiser.model;
|
||||||
|
|
||||||
|
import com.interactivemesh.jfx.importer.Importer;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by fwy13 on 29/08/17.
|
||||||
|
*/
|
||||||
|
public class BoatDisplay3D extends Pane {
|
||||||
|
|
||||||
|
|
||||||
|
public BoatDisplay3D(String filePath){
|
||||||
|
super();
|
||||||
|
// Shape3D
|
||||||
|
// this.getChildren().add();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package visualiser.model;
|
||||||
|
|
||||||
|
import javafx.animation.AnimationTimer;
|
||||||
|
import javafx.scene.Group;
|
||||||
|
import javafx.scene.PerspectiveCamera;
|
||||||
|
import javafx.scene.SubScene;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
|
import javafx.scene.shape.Box;
|
||||||
|
import javafx.scene.shape.CullFace;
|
||||||
|
import javafx.scene.transform.Rotate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by connortaylorbrown on 30/08/17.
|
||||||
|
*/
|
||||||
|
public class View3D extends Pane {
|
||||||
|
SubScene scene;
|
||||||
|
PerspectiveCamera camera;
|
||||||
|
Box box;
|
||||||
|
|
||||||
|
public View3D() {
|
||||||
|
scene = new SubScene(this, 500, 500);
|
||||||
|
camera = new PerspectiveCamera();
|
||||||
|
scene.setCamera(camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spinBox() {
|
||||||
|
camera.getTransforms().add(new Rotate(-20, Rotate.X_AXIS));
|
||||||
|
|
||||||
|
box = new Box(50,50,50);
|
||||||
|
box.setTranslateX(100);
|
||||||
|
box.setTranslateY(100);
|
||||||
|
box.setCullFace(CullFace.BACK);
|
||||||
|
|
||||||
|
Rotate ry = new Rotate(0, 0,0,0, Rotate.Y_AXIS);
|
||||||
|
box.getTransforms().add(ry);
|
||||||
|
|
||||||
|
this.getChildren().add(camera);
|
||||||
|
this.getChildren().add(box);
|
||||||
|
|
||||||
|
AnimationTimer rotation = new AnimationTimer() {
|
||||||
|
@Override
|
||||||
|
public void handle(long now) {
|
||||||
|
ry.setAngle(ry.getAngle() + 0.1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
rotation.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in new issue