本页面

汽车配置器

汽车模型示例,演示如何使用Qt Quick 3D相机、扩展场景环境和Qt Quick 3D。

以沙漠为背景的黑色跑车 3D 侧视图

Car Configurator在不同的场景环境中展示了不同颜色的汽车。它使用 QML 实现,并依赖于许多 Qt 模块,其中最突出的是 Qt QuickQt Quick 3D 模块。

运行示例

要从 Qt Creator打开Welcome 模式,然后从Examples 中选择示例。更多信息,请参阅Qt Creator: 教程:构建并运行

平台注意事项

本示例在运行时会从互联网服务器下载一些资产。因此,首次启动时需要连接互联网。

您可以在两种模式下与汽车模型进行交互:

  • 演示模式
  • 用户模式

演示模式

摄像头视角沿不同路径移动,显示汽车的不同视图。

用户模式

用户可以使用鼠标或触摸输入围绕汽车旋转。

重置摄像头

摄像头移动到初始位置。

场景环境

本示例有四种场景环境可供选择:

  • 车库
  • 沙漠
  • 动画
  • 工作室
车库环境

车库环境作为默认设置,提供了一个简洁的工业演示空间:

ExtendedSceneEnvironment {
    id: showhall

    glowBloom: 0
    glowStrength: 0
    glowEnabled: false
    depthOfFieldFocusDistance: 600
    depthOfFieldFocusRange: 627
    depthOfFieldBlurAmount: 19.97
    depthOfFieldEnabled: false
    exposure: 1.2

    lightProbe: _Hall
    backgroundMode: SceneEnvironment.SkyBox
    tonemapMode: SceneEnvironment.TonemapModeLinear
    probeExposure: 1
    depthPrePassEnabled: false
    depthTestEnabled: true
    antialiasingMode: SceneEnvironment.MSAA
    antialiasingQuality: root.perfMode ? SceneEnvironment.Medium : SceneEnvironment.VeryHigh
    clearColor: "#000000"
    probeHorizon: 0.5

    Texture {
        id: _Hall
        source: root.downloadBase + "/content/images/HDR/_Hall.ktx"
        mipFilter: Texture.Linear
        scaleV: 2
    }
    temporalAAEnabled: false
}
沙漠环境

沙漠环境具有 HDR 天空穹顶照明、大气雾效果和特殊的地面几何形状:

ExtendedSceneEnvironment {
    id: desert

    lightProbe: _Desert
    glowStrength: 2
    glowBloom: 0.11191
    glowEnabled: true

    depthPrePassEnabled: false
    probeExposure: btnRain.checked ? 1.0 : 1.5
    tonemapMode: SceneEnvironment.TonemapModeLinear
    backgroundMode: SceneEnvironment.SkyBox
    depthTestEnabled: true
    antialiasingMode: SceneEnvironment.MSAA
    antialiasingQuality: root.perfMode ? SceneEnvironment.Medium : SceneEnvironment.VeryHigh
    clearColor: "#000000"
    probeHorizon: 0.5
    temporalAAEnabled: false
    fog: Fog {}
}
动画环境

动画环境通过视频墙效果展示动态内容:

ExtendedSceneEnvironment {
    id: videoRoom

    aoSoftness: 0
    aoDistance: 0
    probeExposure: 1
    tonemapMode: SceneEnvironment.TonemapModeLinear
    antialiasingMode: SceneEnvironment.MSAA
    antialiasingQuality: root.perfMode ? SceneEnvironment.Medium : SceneEnvironment.VeryHigh
    clearColor: "#000000"
    depthPrePassEnabled: false
    backgroundMode: SceneEnvironment.Color
    depthTestEnabled: true
    probeHorizon: 0
    Vignette {
        id: vignette
        vignetteStrength: 15
        vignetteColor: Qt.vector3d(0, 0, 0)
    }
    temporalAAEnabled: false
}
演播室环境

演播室环境提供干净、专业的演示环境,灯光可控:

ExtendedSceneEnvironment {
    id: studio
    aoEnabled: false
    antialiasingQuality: SceneEnvironment.VeryHigh
    antialiasingMode: SceneEnvironment.MSAA

    tonemapMode: SceneEnvironment.TonemapModeLinear
    probeExposure: 1
    probeHorizon: 1
    clearColor: "#000000"
    temporalAAEnabled: false
    depthTestEnabled: true
    backgroundMode: SceneEnvironment.Color
    depthPrePassEnabled: false
}

汽车颜色

汽车有四种颜色可供选择:

  • 白色
  • 黑色
  • 黄色
  • 红色

车灯

您可以打开或关闭汽车的灯光。

源文件

示例项目 @ code.qt.io

另请参阅 所有 Qt 示例

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.