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  · 

QGLTwoSidedMaterial Class

The QGLTwoSidedMaterial class implemented two-sided materials for 3D rendering. More...

 #include <QGLTwoSidedMaterial>

Inherits: QGLAbstractMaterial.

This class was introduced in Qt 4.8.

Properties

  • 1 property inherited from QObject

Public Functions

QGLAbstractMaterial(QObject * parent = 0)
QGLTwoSidedMaterial(QObject * parent = 0)
~QGLAbstractMaterial()
~QGLTwoSidedMaterial()
virtual QGLMaterial * back() const
virtual void bind(QGLPainter * painter) = 0
virtual QGLMaterial * front() const
virtual bool isTransparent() const = 0
virtual void prepareToDraw(QGLPainter * painter, const QGLAttributeSet & attributes)
virtual void release(QGLPainter * painter, QGLAbstractMaterial * next) = 0
void setBack(QGLMaterial * material)
void setFront(QGLMaterial * material)

Reimplemented Public Functions

virtual QGLMaterial * back() const
virtual void bind(QGLPainter * painter)
virtual QGLMaterial * front() const
virtual bool isTransparent() const
virtual void prepareToDraw(QGLPainter * painter, const QGLAttributeSet & attributes)
virtual void release(QGLPainter * painter, QGLAbstractMaterial * next)
  • 31 public functions inherited from QObject

Signals

void backChanged()
void frontChanged()
void materialChanged()

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QGLTwoSidedMaterial class implemented two-sided materials for 3D rendering.

Two-sided materials consist of a front() material and a back() material. The specific material rendered is determined by the direction faced by a fragment when it is rendered. Fragments that point towards the viewer are rendered with front(), and fragments that point away from the viewer are rendered with back(). In both cases, any textures that are used to render the material are taken from front().

If front() and back() are the same, then the same material will be used on both sides of the fragment. However, this is not exactly the same as using a one-sided QGLMaterial in place of the two-sided material. One-sided materials will render the back of the fragment as black because the normal is always pointing away from the viewer. Two-sided materials reverse the back-facing normal so that back() is lit as though it was on a front-facing face.

See also QGLMaterial.

Property Documentation

back : QGLMaterial *

This property holds the material for the back side of the object's fragments.

The default value is null, which indicates that front() should be used on both the front and back sides of the object's fragments.

Textures are taken from the front() material. Any textures that appear in the back() material are ignored. Only the material lighting parameters from back() will be used.

Access functions:

virtual QGLMaterial * back() const
void setBack(QGLMaterial * material)

Notifier signal:

void backChanged()

See also front(), backChanged(), and materialChanged().

front : QGLMaterial *

This property holds the material for the front side of the object's fragments.

The default value is null, which will result in a default QGLMaterial object being used when bind() is called.

Access functions:

virtual QGLMaterial * front() const
void setFront(QGLMaterial * material)

Notifier signal:

void frontChanged()

See also back(), frontChanged(), and materialChanged().

Member Function Documentation

QGLTwoSidedMaterial::QGLTwoSidedMaterial(QObject * parent = 0)

Constructs a two-sided material object and attaches it to parent.

See also setFront() and setBack().

QGLTwoSidedMaterial::~QGLTwoSidedMaterial()

Destroys this two-sided material object.

void QGLTwoSidedMaterial::bind(QGLPainter * painter) [virtual]

Reimplemented from QGLAbstractMaterial::bind().

bool QGLTwoSidedMaterial::isTransparent() const [virtual]

Reimplemented from QGLAbstractMaterial::isTransparent().

void QGLTwoSidedMaterial::prepareToDraw(QGLPainter * painter, const QGLAttributeSet & attributes) [virtual]

Reimplemented from QGLAbstractMaterial::prepareToDraw().

void QGLTwoSidedMaterial::release(QGLPainter * painter, QGLAbstractMaterial * next) [virtual]

Reimplemented from QGLAbstractMaterial::release().

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