Replaced 3d model

pull/1449/head
Luca 3 years ago
parent 15c697daf7
commit 5c28c25158

File diff suppressed because one or more lines are too long

@ -221,9 +221,10 @@ TABS.magnetometer.initialize3D = function () {
var modelMaterial = new THREE.MeshFaceMaterial(materials);
gps_model = new THREE.Mesh(geometry, modelMaterial);
gps_model.scale.set(5, 5, 5);
gps_model.scale.set(2.5, 2.5, 2.5);
// TODO This should depend on the selected drone model
gps_model.position.set(0, 0, 25);
gps_model.position.set(0, 0, 27);
gps_model.rotation.y = 3 * Math.PI / 2
scene.add(gps_model);
@ -252,13 +253,11 @@ TABS.magnetometer.initialize3D = function () {
scene.add(camera);
this.render3D = function () {
if (!model) {
if (!model || !gps_model) {
return;
}
gps_model.rotation.x = THREE.Math.degToRad(self.alignmentConfig.pitch);
gps_model.rotation.y = THREE.Math.degToRad(self.alignmentConfig.yaw);
gps_model.rotation.z = THREE.Math.degToRad(self.alignmentConfig.roll);
gps_model.rotation.set(THREE.Math.degToRad(self.alignmentConfig.roll), THREE.Math.degToRad(180-self.alignmentConfig.yaw), THREE.Math.degToRad(self.alignmentConfig.pitch), 'YXZ');
// draw
renderer.render(scene, camera);

Loading…
Cancel
Save