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  · 

QGLDome Class

The QGLDome class represents the geometry of a simple hemisphere in 3D space. More...

 #include <QGLDome>

This class was introduced in Qt 4.8.

Public Functions

QGLDome(qreal diameter = 1.0f, int depth = 3, bool base = true)
virtual ~QGLDome()
bool baseEnabled() const
qreal diameter() const
void setBaseEnabled(bool base)
void setDiameter(qreal diameter)
void setSubdivisionDepth(int depth)
int subdivisionDepth() const

Detailed Description

The QGLDome class represents the geometry of a simple hemisphere in 3D space.

The following example creates a dome of 2 units in diameter and draws it at (10, 25, 0) in a QGLPainter:

 QGLBuilder builder;
 builder << QGLDome(2);
 QGLSceneNode *node = builder.finalizedSceneNode();

 painter.translate(10, 25, 0);
 node->draw(&painter);

The QGLDome class specifies positions, normals and 2D texture co-ordinates for all of the vertices that make up the sphere.

The texture co-ordinates are fixed at construction time. This is because constructing the sphere can involve generating additional vertices which need to interpolate the texture co-ordinates of their neighboring vertices.

The default mode of QGLDome is half of a "UV sphere", which divides the object up into longitudinal and latitudinal sections. The longitudinal slices meet at the pole, which in a single unit dome is defined to be at (0, 0, +0.5) and (0, 0, -0.5). This choice is the simplest to texture map as the texture will only distort along the x-axis of the 2D texture. However the density of vertices is significantly higher at the poles than it is elsewhere on the sphere and is a poor choice if a uniform density of pixels from the texture map is required.

See also QGLBuilder.

Member Function Documentation

QGLDome::QGLDome(qreal diameter = 1.0f, int depth = 3, bool base = true)

Creates a dome of diameter across (default is 1). When the dome is recursively subdivided into triangles, it will be subdivided no more than depth times (between 1 and 5, default is 3).

If base is true, the dome will be drawn with a bottom circle, creating an enclosed solid.

QGLDome::~QGLDome() [virtual]

Destroys this dome object.

bool QGLDome::baseEnabled() const

Returns true if the base of the dome will be created when building the mesh.

The default is true.

See also setBaseEnabled().

qreal QGLDome::diameter() const

Returns the diameter of this dome. The default is 1.

See also setDiameter().

void QGLDome::setBaseEnabled(bool base)

Set whether the bottom of the dome will be created when building the mesh. If base is true, the end-cap will be created.

See also baseEnabled().

void QGLDome::setDiameter(qreal diameter)

Sets the diameter of this dome to diameter.

See also diameter().

void QGLDome::setSubdivisionDepth(int depth)

Sets the maximum depth when this hemisphere is subdivided into triangles.

See also subdivisionDepth().

int QGLDome::subdivisionDepth() const

Returns the maximum depth when this hemisphere is subdivided into triangles. The default is 3. The following picture shows the effect of depth values between 1 and 5 for a UV sphere (hemisphere subdivision depth shares this scheme).

See also setSubdivisionDepth() and QGLSphere::subdivisionDepth().

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