Qt公司宣布其新的高级3D API
时间:2021-02-21
从最近的Qt6工具包的技术愿景继续,Qt公司现在宣布他们为Qt的下一个主要版本开发的新的高级3D API。 dedecms.com
Qt Quick 3D是这个新的高级API,用于从Qt Quick中为用户界面创建3D内容,而无需任何外部引擎。 Qt Quick 3D将使用Qt 3D STUDIO目前使用的渲染器。
该公司希望Qt Quick 3D能够提供统一的图形支持,易于使用的API,,具有现有Qt Quick的统一工具,跨平台性能/兼容性以及其他功能。 Qt Quick 3D将由Vulkan,Metal,Direct3D或OpenGL在后端呈现,具体取决于平台。这款新的Qt Quick 3D API不能替代现有的Qt 3D。
织梦好,好织梦
在考虑Qt6的同时,Qt公司的目标是将Qt Quick 3D作为Qt 5.14的技术预览添加,他们已经拥有了一个可用于Qt 5.12 LTS和更新版本的外部组件。
织梦好,好织梦
Qt Quick 3D不是Qt 3D的替代品,而是Qt Quick功能的扩展,使用高级API渲染3D内容。 dedecms.com
这是一个非常简单的项目,其中包含一些有用的注释:
copyright dedecms
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick3D 1.0
Window {
id: window
visible: true
width: 1280
height: 720
// Viewport for 3D content
View3D {
id: view
anchors.fill: parent
// Scene to view
Node {
id: scene
Light {
id: directionalLight
}
Camera {
id: camera
// It's important that your camera is not inside
// your model so move it back along the z axis
// The Camera is implicitly facing up the z axis,
// so we should be looking towards (0, 0, 0)
z: -600
}
Model {
id: cubeModel
// #Cube is one of the "built-in" primitive meshes
// Other Options are:
// #Cone, #Sphere, #Cylinder, #Rectangle
source: "#Cube"
// When using a Model, it is not enough to have a
// mesh source (ie "#Cube")
// You also need to define what material to shade
// the mesh with. A Model can be built up of
// multiple sub-meshes, so each mesh needs its own
织梦内容管理系统
// material. Materials are defined in an array,
// and order reflects which mesh to shade
// All of the default primitive meshes contain one
// sub-mesh, so you only need 1 material.
materials: [
DefaultMaterial {
// We are using the DefaultMaterial which
// dynamically generates a shader based on what
// properties are set. This means you don't
// need to write any shader code yourself.
// In this case we just want the cube to have
// a red diffuse color.
id: cubeMaterial
diffuseColor: "red"
}
]
}
}
}
} 织梦内容管理系统
上一篇:长春黄金饰品也玩“3D”概念 工艺费最高80元/克 下一篇:没有了