Using new arrow / arrow textures. Made sails not clickable.

main
Joseph 8 years ago
parent affbb69029
commit 699df2e775

@ -19,6 +19,8 @@ import javafx.scene.transform.Rotate;
import shared.model.Bearing;
import shared.model.CompoundMark;
import shared.model.GPSCoordinate;
import visualiser.layout.Annotation3D;
import visualiser.layout.Assets3D;
import visualiser.layout.Subject3D;
import visualiser.layout.View3D;
import visualiser.model.VisualiserBoat;
@ -57,24 +59,16 @@ public class NextMarkController {
private void initialise3dArrowView() {
ObservableList<Subject3D> viewSubjects = FXCollections.observableArrayList();
URL asset = this.getClass().getClassLoader().getResource("assets/arrow V1.0.4.stl");
StlMeshImporter importer = new StlMeshImporter();
importer.read(asset);
String arrowPath = "assets/mark_arrow.x3d";
MeshView arrow = new MeshView(importer.getImport());
PhongMaterial arrowMat = new PhongMaterial(Color.GREEN);
arrow.setMaterial(arrowMat);
AmbientLight ambientLight = new AmbientLight(Color.web("#777777"));
ambientLight.setLightOn(true);
Shape3D arrow = Assets3D.loadX3d(arrowPath);
arrow.setScaleX(25);
arrow.setScaleY(25);
arrow.setScaleZ(200);
arrow.setScaleZ(100);
arrow.setRotationAxis(new Point3D(1,0,0));
arrowStackPane3d.getChildren().add(arrow);
//arrowStackPane3d.getChildren().add(ambientLight);
AnimationTimer arrow3d = new AnimationTimer() {
@Override
@ -101,7 +95,7 @@ public class NextMarkController {
private double calculateZRotate() {
CompoundMark target = boat.getCurrentLeg().getEndCompoundMark();
Bearing headingToMark = GPSCoordinate.calculateBearing(boat.getPosition(), target.getAverageGPSCoordinate());
return -headingToMark.degrees() + boat.getBearing().degrees();
return -headingToMark.degrees() + boat.getBearing().degrees() + 180;
}
private double calculateXRotate(double zRotation) {
@ -115,6 +109,7 @@ public class NextMarkController {
zRotation = 360 - zRotation;
}
return 90 - 20 * Math.cos(Math.toRadians(zRotation));
return 110;
// return 90 - 20 * Math.cos(Math.toRadians(zRotation));
}
}

@ -420,6 +420,7 @@ public class RaceViewController extends Controller {
//add sail
Sails3D sails3D = new Sails3D();
Subject3D sailsSubject = new Subject3D(sails3D, 0);
sails3D.setMouseTransparent(true);
sails3D.setMaterial(boatColorMat);
sailsSubject.setXRot(0d);
sailsSubject.setHeading(visualiserRace.getVisualiserRaceState().getWindDirection().degrees());

@ -52,7 +52,7 @@ public class Assets3D {
windArrow = new Annotation3D(loadX3d(arrowPath));
}
private static Shape3D loadX3d(String path){
public static Shape3D loadX3d(String path){
X3dModelImporter x3dModelImporter = new X3dModelImporter();
URL asset = Assets3D.class.getClassLoader().getResource(path);
x3dModelImporter.read(asset);

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D version="3.0" profile="Immersive" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.0.xsd">
<head>
<meta name="filename" content="Mark Arrow V1.3.x3d" />
<meta name="generator" content="Blender 2.77 (sub 0)" />
</head>
<Scene>
<NavigationInfo headlight="true"
visibilityLimit="0.0"
type='"EXAMINE", "ANY"'
avatarSize="0.25, 1.75, 0.75"
/>
<Background DEF="WO_World"
groundColor="0.051 0.051 0.051"
skyColor="0.051 0.051 0.051"
/>
<Transform DEF="Cube_TRANSFORM"
translation="0.000000 0.000000 0.000000"
scale="1.000000 1.000000 1.000000"
rotation="0.000000 0.707107 0.707107 3.141593"
>
<Transform DEF="Cube_ifs_TRANSFORM"
translation="0.000000 0.000000 0.000000"
scale="1.000000 1.000000 1.000000"
rotation="1.000000 0.000000 0.000000 0.000000"
>
<Group DEF="group_ME_Cube">
<Shape>
<Appearance>
<ImageTexture DEF="IM_Material_Diffuse_Color_002"
url='"textures/Material Diffuse Color.002" "Material Diffuse Color.002" "D:/Storage/3D Models/Misc/SENG302/Mark Arrow/textures/Material Diffuse Color.002"'
/>
<TextureTransform
translation="0.000000 0.000000"
scale="1.000000 1.000000"
rotation="0.000000"
/>
<Material DEF="MA_Material"
diffuseColor="0.800 0.800 0.800"
specularColor="0.401 0.401 0.401"
emissiveColor="0.000 0.000 0.000"
ambientIntensity="0.333"
shininess="0.098"
transparency="0.0"
/>
</Appearance>
<IndexedFaceSet solid="true"
texCoordIndex="0 1 2 -1 3 4 5 -1 6 7 8 9 -1 10 11 12 -1 13 14 15 -1 16 17 18 19 -1 20 21 22 -1 23 24 25 -1 26 27 28 29 -1 30 31 32 -1 33 34 35 -1 36 37 38 39 -1 "
coordIndex="4 1 7 -1 2 0 8 -1 1 0 2 3 -1 1 3 7 -1 8 0 9 -1 0 1 4 9 -1 4 7 6 -1 2 8 5 -1 6 3 2 5 -1 6 7 3 -1 8 9 5 -1 4 6 5 9 -1 "
>
<Coordinate DEF="coords_ME_Cube"
point="1.000000 -0.000000 -0.100000 1.000000 -0.000001 0.100000 0.000000 2.000000 -0.100000 0.000000 2.000000 0.100000 0.000000 -2.000000 0.100000 -1.000000 -0.000000 -0.100000 -1.000000 -0.000001 0.100000 0.000000 -0.000000 0.100000 0.000000 0.000000 -0.100000 0.000000 -2.000000 -0.100000 "
/>
<TextureCoordinate point="0.9999 0.0001 0.7826 0.0001 0.8260 0.0870 0.6522 0.1934 0.7826 0.3673 0.8260 0.2803 0.4348 0.1740 0.4348 0.1934 0.6522 0.1934 0.6522 0.1740 0.7826 0.0001 0.6522 0.1740 0.8260 0.0870 0.8260 0.2803 0.7826 0.3673 0.9999 0.3673 0.4348 0.1934 0.4348 0.1740 0.2174 0.1740 0.2174 0.1934 0.9999 0.0001 0.8260 0.0870 0.8695 0.1740 0.6522 0.1934 0.8260 0.2803 0.8695 0.1934 0.8695 0.1740 0.6522 0.1740 0.6522 0.1934 0.8695 0.1934 0.8695 0.1740 0.8260 0.0870 0.6522 0.1740 0.8260 0.2803 0.9999 0.3673 0.8695 0.1934 0.2174 0.1740 0.0001 0.1740 0.0001 0.1934 0.2174 0.1934 " />
</IndexedFaceSet>
</Shape>
</Group>
</Transform>
</Transform>
</Scene>
</X3D>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Loading…
Cancel
Save