mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-27 16:06:28 +02:00
[ui][3D] add EnvironmentMapEntity to display equirectangular images
Load EXR files in the 3D viewport as environment maps mapped on a sphere "attached" to the camera. * improve exr loading strategy by considering depthmaps and env maps * update to DepthMapEntity 2.1 (required to get the loading status)
This commit is contained in:
parent
fbfb7d6143
commit
63ffb20819
5 changed files with 82 additions and 9 deletions
48
meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml
Normal file
48
meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml
Normal file
|
@ -0,0 +1,48 @@
|
|||
import QtQuick 2.9
|
||||
import Qt3D.Core 2.1
|
||||
import Qt3D.Render 2.1
|
||||
import Qt3D.Extras 2.10
|
||||
|
||||
|
||||
/**
|
||||
* EnvironmentMap maps an equirectangular image on a Sphere.
|
||||
* The 'position' property can be used to virually attach it to a camera
|
||||
* and get the impression of an environment at an infinite distance.
|
||||
*/
|
||||
Entity {
|
||||
id: root
|
||||
|
||||
/// Source of the equirectangular image
|
||||
property url source
|
||||
/// Radius of the sphere
|
||||
property alias radius: sphereMesh.radius
|
||||
/// Number of slices of the sphere
|
||||
property alias slices: sphereMesh.slices
|
||||
/// Number of rings of the sphere
|
||||
property alias rings: sphereMesh.rings
|
||||
/// Position of the sphere
|
||||
property alias position: transform.translation
|
||||
|
||||
components: [
|
||||
SphereMesh {
|
||||
id: sphereMesh
|
||||
radius: 1000
|
||||
slices: 50
|
||||
rings: 50
|
||||
},
|
||||
Transform {
|
||||
id: transform
|
||||
translation: root.position
|
||||
},
|
||||
DiffuseMapMaterial {
|
||||
ambient: "#FFF"
|
||||
shininess: 0
|
||||
specular: "#000"
|
||||
diffuse: TextureLoader {
|
||||
magnificationFilter: Texture.Linear
|
||||
mirrored: true
|
||||
source: root.source
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue