#Qt6.9
import QtQuick
import QtQuick3D
import QtQuick3D.Helpers
Window {
width: 800
height: 600
visible: true
title: qsTr("旋转光源示例")
View3D {
anchors.fill: parent
environment: SceneEnvironment {
clearColor: "#222222"
backgroundMode: SceneEnvironment.Color
}
PerspectiveCamera {
position: Qt.vector3d(0, 200, 600)
}
// 球体模型
Model {
source: "#Sphere"
scale: Qt.vector3d(2, 2, 2)
position: Qt.vector3d(0, 200, 0)
materials: PrincipledMaterial {
baseColor: "blue"
roughness: 0.1
metalness: 0.5
specularAmount: 1.0
}
}
// 方向光源 - 绕Y轴旋转
DirectionalLight {
id: dirLight
color: "white"
brightness: 1
eulerRotation.y: 0
// Y轴旋转动画
Nu
Qt6.9 Qt Quick 3D实现球体转动效果

最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



