Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Mesh

The Mesh item provides a means of abstracting 3D mesh and geometry representations in a way that can be used in QML. The Mesh class contains necessary properties and methods for display and manipulation of 3d objects of this type. More...

Inherits QtObject

Inherited by CapsuleMesh and CylinderMesh.

This type was introduced in Qt 4.8.

Properties

Signals

Detailed Description

Underlying Architecture

QML/3d Mesh objects are a QML enabled means of representing any scene class based on the QGLAbstractScene class.

In cases where the scene is composed of multiple nodes (for example, in a .3ds file) the mesh allows users to split away branches of the tree and manipulate them in isolation from the original scene graph.

In order to achieve this the mesh object contains a map correlating numeric identifiers for individual branches with specific QGLSceneNode objects which are taken from the original scene.

More details on achieving this can be found in the Item3D class.

Specifying Simple Mesh Objects

Like other objects in QML/3d, Mesh objects are created by the standard QML syntax for objects. Meshes should always specify an appropriate file containing the data for the Mesh:

 Mesh {
     id: teapot_mesh
     source: "teapot.bez"
 }

More complex effects use the usual QML syntax for accessing and updating properties. In order to specify a texture, for example, the following could be used:

 Mesh {
     id: teapot_mesh
     source: "teapot.bez"
     effect: Effect {
         texture: "texture.png"
     }
 }

For objects loaded from the network we can wait for an "onLoaded" signal in QML (from the loaded() signal in the Mesh class) before performing specific actions. For example:

 Item3D {
     id: theMesh
     mesh: Mesh {
         source: "http://www.example_3d_model_url.com/sample.obj"
         onLoaded:{theMesh.effect=theEffect}
     }

     Effect {
         id: theEffect
         texture: ":/qml/texture.jpg" }
     }
 }

This code will wait until the mesh has been fully loaded before attempting to apply the effects.

Property Documentation

dumpInfo : bool

Flag set to true if the description of the item will be dumped to the console.

When this flag is true, useful debugging and diagnostic information, for example the names of all the subnodes of the mesh, materials and geometry parameters, will be dumped to the console during the loading of the model.


getSceneObject : QGLSceneNode

Get the main scene node for the QGLAbstractScene associated with this mesh.


meshName : string

Users can associate a name with a mesh to facilitate easy finding or description of a mesh.


options : string

The behaviour of the underlying file loader can be controlled by string encoded options. Consult the documentation for each loader for the options available.

Specifies the current options for loading this mesh. The default value is the null string, meaning no options are applied.


source : url

Each mesh requires a set of data that describes (among other things) vertices transformations, textures, and so on. This data is generally stored in files and specified via the source property.

Source files can be of any type supported by Qt3D. The types of file currently supported can be found in the sceneFormat plugins, with .3ds, .bez, .obj, .dae files currently being supported.

Meshes can also be stored within QRC files and loaded via the standard resource mechanisms, however there may be issues with some esoteric remote resource loading requirements within the different file types.


viewport : Viewport

This property holds the viewport which this Skybox will be displayed inside. The skybox will completely fill the viewport, but since it is drawn first, and with depth buffering off, all other content in the given viewport will overlay the skybox making it appear infinitely distant.

Generally this property should not need to be set as the skybox can be simply placed inside the viewport element in which it should display.


Signal Documentation

Mesh::loaded()

This handler is called when mesh loading is complete.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web