首页| 论坛| 消息

标题:QML进行Qt3D场景绘制正常,但使用C++却不行
作者:ylw123
日期:2018-03-16 06:16
内容:

用QML绘制一个Qt3D场景,使其背景为渐变色,效果如下,一切正常


QML的代码如下,


import QtQuick 2.1 as QQ2
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Input 2.0
import Qt3D.Extras 2.0

Entity {
id: root

RenderSettings {
id: renderSettings
activeFrameGraph: ForwardRenderer {
}
}



Entity {
id: background1


components:

PlaneMesh {
id: mesh
width: 2.0
height: 2.0
meshResolution: Qt.size( 2, 2 )
}

Transform {
id: transform
// Rotate the plane so that it faces us
rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 90)
}

Material {
id: material
effect:effect1

Effect {
&nbsp ..


#1 [never_forget 03-16 08:41]
3D 我不是很懂,但是楼主 6 点就来发帖子的精神深深打动了我~
#2 [mmario 03-16 11:47]
3D还不是很多,希望以后和楼主多多交流!
#3 [optphantom 03-17 23:52]
Qt3D不会,只会OpenGL

回复 发表
主题 版块