Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
Qt3D Core: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:Developing_with_Qt::Qt3D]] | [[Category:Developing_with_Qt::Qt3D]] | ||
[toc align_right="yes" depth="3"] | |||
= Qt3D Core = | = Qt3D Core = | ||
Line 21: | Line 22: | ||
==== Transformations ==== | ==== Transformations ==== | ||
===== * '''Transform''' | ===== * '''Transform''' | ||
A Component that contains a list of transformation | |||
<code>Transform { | |||
id : transform_0 | |||
Rotate { | |||
axis : Qt.vector3d(0,1,0) | |||
angle : 30 | |||
} | |||
Scale { | |||
scale3D : Qt.vector3d(0.5, 0.25, 0.5) | |||
} | |||
Translate { | |||
dx : –9; dy : 2; dz : 20 | |||
} | |||
}</code> ===== | |||
===== * '''LookAtTransform''' | ===== * '''LookAtTransform''' | ||
Performs a LookAtTransform. ===== | |||
===== * '''MatrixTransform''' | ===== * '''MatrixTransform''' | ||
Performs a transformation based on the Matrix provided. ===== | |||
===== * '''TranslateTransform''' | ===== * '''TranslateTransform''' | ||
Performs a translation. ===== | |||
===== * '''RotateTransform''' | ===== * '''RotateTransform''' | ||
Performs a rotation around an axis. ===== | |||
===== * '''ScaleTransform''' | ===== * '''ScaleTransform''' | ||
Performs a scaling. ===== | |||
[[Image:http://i58.tinypic.com/2poe3bn.png|http://i58.tinypic.com/2poe3bn.png]] | [[Image:http://i58.tinypic.com/2poe3bn.png|http://i58.tinypic.com/2poe3bn.png]] | ||
Line 37: | Line 57: | ||
==== Others Components ==== | ==== Others Components ==== | ||
===== * '''CameraLens''' | ===== * '''CameraLens''' | ||
Contains the lens properties of a Camera. | |||
'''''' Projection Type | |||
'''''' Far plane | |||
'''''' Near plane | |||
'''''' Field of view | |||
'''''' Aspect ratio ===== | |||
=== Custom elements === | === Custom elements === | ||
Line 43: | Line 69: | ||
Custom elements can be created by subclassing an Entity and predefining a set of properties. | Custom elements can be created by subclassing an Entity and predefining a set of properties. | ||
===== * '''Camera''' | ===== * '''Camera''' | ||
The Camera elements is an Entity that contains a Transform and a CameraLens. | |||
<code>Camera { | |||
id : camera2 ===== | |||
lens : CameraLens { | lens : CameraLens { | ||
projectionType: CameraLens.PerspectiveProjection | |||
fieldOfView: 45 | |||
aspectRatio: 16/9 | |||
nearPlane : 0.01 | |||
farPlane : 1000.0 | |||
} | |||
transform : Transform { | transform : Transform { | ||
LookAt { | |||
position: Qt.vector3d( 0.0, –1.0, –5.0 ) | |||
upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) | |||
viewCenter: Qt.vector3d( 0.0, 2.0, 10.0 ) | |||
} | |||
Rotate { | |||
axis : Qt.vector3d(0, 0, 1) | |||
angle : 40 | |||
} | |||
} | |||
}</code> | |||
== Resources Management == | == Resources Management == | ||
Line 57: | Line 103: | ||
* QListResourcesManager | * QListResourcesManager | ||
The use of a Handle systems allows for resources to be easily accessed and managed while allowing for memory structure to be realigned so as to maintain a contiguous memory alignment and reduce fragmentation. | The use of a Handle systems allows for resources to be easily accessed and managed while allowing for memory structure to be realigned so as to maintain a contiguous memory alignment and reduce fragmentation. | ||
This should lower the amount of cache misses and speed up rendering. | |||
Other Resources management oriented classes include : | Other Resources management oriented classes include : | ||
* QCircularBuffer |
Revision as of 10:13, 25 February 2015
[toc align_right="yes" depth="3"]
Qt3D Core
Core elements
The Core exposes a few default elements that make up all Qt3D scenes.
Node
A base Qt3D element.
Entity
An Entity is a Node which has a list of Component properties. This is the type of elements that are actually rendered.
Component
Components are elements that are used to further specify an Entity.
Transformations
===== * Transform A Component that contains a list of transformation
Transform {
id : transform_0
Rotate {
axis : Qt.vector3d(0,1,0)
angle : 30
}
Scale {
scale3D : Qt.vector3d(0.5, 0.25, 0.5)
}
Translate {
dx : –9; dy : 2; dz : 20
}
}
=====
===== * LookAtTransform Performs a LookAtTransform. =====
===== * MatrixTransform Performs a transformation based on the Matrix provided. =====
===== * TranslateTransform Performs a translation. =====
===== * RotateTransform Performs a rotation around an axis. =====
===== * ScaleTransform Performs a scaling. =====
http://i58.tinypic.com/2poe3bn.png
Others Components
===== * CameraLens Contains the lens properties of a Camera. ' Projection Type ' Far plane ' Near plane ' Field of view ' Aspect ratio =====
Custom elements
Custom elements can be created by subclassing an Entity and predefining a set of properties.
===== * Camera The Camera elements is an Entity that contains a Transform and a CameraLens.
Camera {
id : camera2 =====
lens : CameraLens {
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 45
aspectRatio: 16/9
nearPlane : 0.01
farPlane : 1000.0
}
transform : Transform {
LookAt {
position: Qt.vector3d( 0.0, –1.0, –5.0 )
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
viewCenter: Qt.vector3d( 0.0, 2.0, 10.0 )
}
Rotate {
axis : Qt.vector3d(0, 0, 1)
angle : 40
}
}
}
Resources Management
To achieve high rendering performances, the memory access to the resources has to be properly managed and structured. Therefore, a set of templated resources management oriented classes have been developed in the core of Qt3D.
- QHandle
- QArrayResourcesManager
- QListResourcesManager
The use of a Handle systems allows for resources to be easily accessed and managed while allowing for memory structure to be realigned so as to maintain a contiguous memory alignment and reduce fragmentation. This should lower the amount of cache misses and speed up rendering.
Other Resources management oriented classes include :
- QCircularBuffer