Qt3D Core: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Qt3D Core=
[[Category:Developing_with_Qt::Qt3D]]<br />[toc align_right=&quot;yes&amp;quot; depth=&quot;3&amp;quot;]


==Core elements==
= Qt3D Core =
 
== Core elements ==


The Core exposes a few default elements that make up all Qt3D scenes.
The Core exposes a few default elements that make up all Qt3D scenes.


===Node===
=== Node ===


A base Qt3D element.
A base Qt3D element.


===Entity===
=== Entity ===


An Entity is a Node which has a list of Component properties. This is the type of elements that are actually rendered.
An Entity is a Node which has a list of Component properties. This is the type of elements that are actually rendered.


===Component===
=== Component ===


Components are elements that are used to further specify an Entity.
Components are elements that are used to further specify an Entity.


====Transformations====
==== Transformations ====


==========
===== * '''Transform'''<br />A Component that contains a list of transformation<br /><code>Transform {<br /> id : transform_0<br /> Rotate {<br /> axis : Qt.vector3d(0,1,0)<br /> angle : 30<br /> }<br /> Scale {<br /> scale3D : Qt.vector3d(0.5, 0.25, 0.5)<br /> }<br /> Translate {<br /> dx : –9; dy : 2; dz : 20<br /> }<br /> }</code> =====


* '''Transform'''<br /> A Component that contains a list of transformation<br />
===== * '''LookAtTransform'''<br />Performs a LookAtTransform. =====


==========
===== * '''MatrixTransform'''<br />Performs a transformation based on the Matrix provided. =====


* '''LookAtTransform'''<br /> Performs a LookAtTransform.
===== * '''TranslateTransform'''<br />Performs a translation. =====


==========
===== * '''RotateTransform'''<br />Performs a rotation around an axis. =====


* '''MatrixTransform'''<br /> Performs a transformation based on the Matrix provided.
===== * '''ScaleTransform'''<br />Performs a scaling. =====


==========
[[Image:http://i58.tinypic.com/2poe3bn.png|http://i58.tinypic.com/2poe3bn.png]]


* '''TranslateTransform'''<br /> Performs a translation.
==== Others Components ====


==========
===== * '''CameraLens'''<br />Contains the lens properties of a Camera.<br />'''''' Projection Type<br />'''''' Far plane<br />'''''' Near plane<br />'''''' Field of view<br />'''''' Aspect ratio =====


* '''RotateTransform'''<br /> Performs a rotation around an axis.
=== Custom elements ===


==========
Custom elements can be created by subclassing an Entity and predefining a set of properties.
 
* '''ScaleTransform'''<br /> Performs a scaling.
 
[[Image:2poe3bn.png]]
 
====Others Components====
 
==========
 
* '''CameraLens'''<br /> Contains the lens properties of a Camera.
** Projection Type
** Far plane
** Near plane
** Field of view
** Aspect ratio


===Custom elements===
===== * '''Camera'''<br />The Camera elements is an Entity that contains a Transform and a CameraLens.<br /><code>Camera {<br /> id : camera2 =====
 
Custom elements can be created by subclassing an Entity and predefining a set of properties.


==========
lens : CameraLens {<br /> projectionType: CameraLens.PerspectiveProjection<br /> fieldOfView: 45<br /> aspectRatio: 16/9<br /> nearPlane : 0.01<br /> farPlane : 1000.0<br /> }


* '''Camera'''<br /> The Camera elements is an Entity that contains a Transform and a CameraLens.<br />
transform : Transform {<br /> LookAt {<br /> position: Qt.vector3d( 0.0, –1.0, –5.0 )<br /> upVector: Qt.vector3d( 0.0, 1.0, 0.0 )<br /> viewCenter: Qt.vector3d( 0.0, 2.0, 10.0 )<br /> }<br /> Rotate {<br /> axis : Qt.vector3d(0, 0, 1)<br /> angle : 40<br /> }<br /> }<br /> }</code>


==Resources Management==
== 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.
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.
Line 72: Line 57:
* 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.<br /> This should lower the amount of cache misses and speed up rendering.
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.<br />This should lower the amount of cache misses and speed up rendering.
 
Other Resources management oriented classes include :
 
* QCircularBuffer
* QBoundedCircularBuffer
 
===Categories:===


* [[:Category:Developing with Qt|Developing_with_Qt]]
Other Resources management oriented classes include :<br />* QCircularBuffer
** [[:Category:Developing with Qt::Qt3D|Qt3D]]

Revision as of 09:53, 24 February 2015


[toc align_right="yes&quot; depth="3&quot;]

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 {<br /> id : transform_0<br /> Rotate {<br /> axis : Qt.vector3d(0,1,0)<br /> angle : 30<br /> }<br /> Scale {<br /> scale3D : Qt.vector3d(0.5, 0.25, 0.5)<br /> }<br /> Translate {<br /> dx : 9; dy : 2; dz : 20<br /> }<br /> }
* 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 {<br /> id : camera2 =====

lens : CameraLens {<br /> projectionType: CameraLens.PerspectiveProjection<br /> fieldOfView: 45<br /> aspectRatio: 16/9<br /> nearPlane : 0.01<br /> farPlane : 1000.0<br /> }

transform : Transform {<br /> LookAt {<br /> position: Qt.vector3d( 0.0, 1.0, 5.0 )<br /> upVector: Qt.vector3d( 0.0, 1.0, 0.0 )<br /> viewCenter: Qt.vector3d( 0.0, 2.0, 10.0 )<br /> }<br /> Rotate {<br /> axis : Qt.vector3d(0, 0, 1)<br /> angle : 40<br /> }<br /> }<br /> }

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