我正在使用增強現實 (AR) 以比使用觸摸或滑鼠界面更自然地快速探索場景。
我們可以使用 AR 進入一個區域并可視化資訊,例如提議的開發專案或城市的歷史模型。我們可以使用天橋 AR 通過虛擬步行來探索城市。
下面是我實作它的代碼,但現在我想添加平移因子以實作場景中的快速移動,并且我想創造環境的氛圍和效果。
有什么幫助嗎?
import QtQuick 2.6
import QtQuick.Controls 2.12
import Esri.ArcGISRuntime 100.12
import Esri.ArcGISExtras 1.1
import Esri.ArcGISArToolkit 1.0
Rectangle {
id: rootRectangle
clip: true
width: 800
height: 600
ArcGISArView {
id: arcGISArView
anchors.fill: parent
tracking: true
sceneView: sceneView
}
SceneView {
id: sceneView
anchors.fill: parent
Scene {
id: scene
Basemap {
initStyle: Enums.BasemapStyleArcGISImageryStandard
}
Surface {
opacity: 0.0
ArcGISTiledElevationSource {
url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
}
}
// create the integrated mesh layer
IntegratedMeshLayer {
id: integratedMeshLayer
url: "https://www.arcgis.com/home/item.html?id=5c55d0d1f21e489193cdeff11460a28c"
onl oadStatusChanged: {
if (loadStatus !== Enums.LoadStatusLoaded)
return;
// Enable subsurface navigation. This allows you to look at the scene from below.
sceneView.scene.baseSurface.navigationConstraint = Enums.NavigationConstraintStayAbove;
scene.baseSurface.opacity = 1.0;
// Start with the camera at the center of the mesh layer.
const viewPoint = ArcGISRuntimeEnvironment.createObject("Point", {
y: integratedMeshLayer.fullExtent.center.y,
x: integratedMeshLayer.fullExtent.center.x,
z: 250.0
});
const originCamera = ArcGISRuntimeEnvironment.createObject("Camera", {
location: viewPoint,
heading: 0,
pitch: 90,
roll: 0
});
arcGISArView.originCamera = originCamera;
one rrorChanged: {
console.log("(%1)[%2] %3 - %4".arg(error.code).arg(error.domain).arg(error.message).arg(error.additionalMessage));
}
}
}
}
}
uj5u.com熱心網友回復:
您可以設定平移因子以啟用場景中的快速移動,如下所示:
arcGISArView.translationFactor = 1000;
并啟用氛圍和空間效果以獲得更加身臨其境的體驗。
sceneView.spaceEffect = Enums.SpaceEffectStars;
sceneView.atmosphereEffect = Enums.AtmosphereEffectRealistic;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/337947.html
標籤:qt 质量管理器 地理信息系统 arcgis-服务器
