mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-09 22:32:19 +02:00
[Panorama Viewer] Pass Euler angle to sfm node
This commit is contained in:
parent
ed853d5628
commit
733362fe1d
1 changed files with 19 additions and 5 deletions
|
@ -57,6 +57,9 @@ AliceVision.PanoramaViewer {
|
||||||
property var lastX : 0
|
property var lastX : 0
|
||||||
property var lastY: 0
|
property var lastY: 0
|
||||||
|
|
||||||
|
property int yaw: 0;
|
||||||
|
property int pitch: 0;
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: containerPanorama
|
id: containerPanorama
|
||||||
z: 10
|
z: 10
|
||||||
|
@ -87,7 +90,8 @@ AliceVision.PanoramaViewer {
|
||||||
lastX = mouse.x;
|
lastX = mouse.x;
|
||||||
lastY = mouse.y;
|
lastY = mouse.y;
|
||||||
for (var i = 0; i < repeater.model; i++) {
|
for (var i = 0; i < repeater.model; i++) {
|
||||||
repeater.itemAt(i).item.rotatePanorama(xoffset * 0.001 * mouseMultiplier, -yoffset * 0.001 * mouseMultiplier)
|
//repeater.itemAt(i).item.rotatePanorama((xoffset / width) * mouseMultiplier, -(yoffset / height) * mouseMultiplier)
|
||||||
|
repeater.itemAt(i).item.rotatePanorama(0, -(yoffset / height) * mouseMultiplier)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +103,18 @@ AliceVision.PanoramaViewer {
|
||||||
}
|
}
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
|
if (isRotating)
|
||||||
|
{
|
||||||
|
// Update Euler angles
|
||||||
|
var activeNode = _reconstruction.activeNodes.get('sfm').node;
|
||||||
|
|
||||||
|
root.yaw = repeater.itemAt(0).item.getYaw();
|
||||||
|
root.pitch = repeater.itemAt(0).item.getPitch();
|
||||||
|
|
||||||
|
activeNode.attribute("manualTransform.manualRotation.y").value = root.yaw;
|
||||||
|
activeNode.attribute("manualTransform.manualRotation.x").value = root.pitch;
|
||||||
|
}
|
||||||
|
|
||||||
isRotating = false;
|
isRotating = false;
|
||||||
lastX = 0
|
lastX = 0
|
||||||
lastY = 0
|
lastY = 0
|
||||||
|
@ -180,7 +196,8 @@ AliceVision.PanoramaViewer {
|
||||||
'index' : index,
|
'index' : index,
|
||||||
'idView': Qt.binding(function() { return cId; }),
|
'idView': Qt.binding(function() { return cId; }),
|
||||||
})
|
})
|
||||||
console.warn(cSource)
|
//repeater.itemAt(index).item.rotatePanorama(yaw * (3.14 / 180), pitch * (3.14 / 180))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
|
||||||
setSource("", {})
|
setSource("", {})
|
||||||
|
@ -198,8 +215,6 @@ AliceVision.PanoramaViewer {
|
||||||
target: root
|
target: root
|
||||||
onImagesDataChanged: {
|
onImagesDataChanged: {
|
||||||
//We receive the map<ImgPath, idView> from C++
|
//We receive the map<ImgPath, idView> from C++
|
||||||
console.warn("IMAGES DATA CHANGED ! " + imagesData)
|
|
||||||
|
|
||||||
//Resetting arrays to avoid problem with push
|
//Resetting arrays to avoid problem with push
|
||||||
pathList = []
|
pathList = []
|
||||||
idList = []
|
idList = []
|
||||||
|
@ -223,7 +238,6 @@ AliceVision.PanoramaViewer {
|
||||||
if(repeater.model !== root.pathList.length){
|
if(repeater.model !== root.pathList.length){
|
||||||
repeater.model = 0;
|
repeater.model = 0;
|
||||||
}
|
}
|
||||||
//console.warn(imagesData.length)
|
|
||||||
repeater.model = root.pathList.length;
|
repeater.model = root.pathList.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue