このページでは

Qt3DExtras::QPhongMaterial Class

class Qt3DExtras::QPhongMaterial

QPhongMaterial クラスは、フォン照明効果のデフォルトの実装を提供します。詳細...

ヘッダー: #include <qphongmaterial.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
継承元: Qt3DRender::QMaterial
ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

プロパティ

パブリック関数

QPhongMaterial(Qt3DCore::QNode *parent = nullptr)
virtual ~QPhongMaterial()
QColor ambient() const
QColor diffuse() const
float shininess() const
QColor specular() const

パブリック・スロット

void setAmbient(const QColor &ambient)
void setDiffuse(const QColor &diffuse)
void setShininess(float shininess)
void setSpecular(const QColor &specular)

シグナル

void ambientChanged(const QColor &ambient)
void diffuseChanged(const QColor &diffuse)
void shininessChanged(float shininess)
void specularChanged(const QColor &specular)

詳細な説明

このクラスは非推奨です。代わりにQDiffuseSpecularMaterial を使用してください。

フォン照明効果は、アンビエント、ディフューズ、スペキュラーという 3 つの照明コンポーネントの組み合わせに基づいています。これらのコンポーネントの相対的な強度は、RGB の 3 値としてモデル化された反射率係数によって制御されます。

  • アンビエントは、他の光源がない状態でオブジェクトから放出される色です。
  • ディフューズは、光が粗い表面で反射した際に発せられる色です。
  • スペキュラーは、光が光沢のある表面で反射した際に発せられる色です。
  • 表面の光沢度は、float型のプロパティによって制御されます。

このマテリアルは、シングルレンダリングパス方式の効果を使用し、フラグメントごとのライティングを実行します。OpenGL 2、OpenGL 3 以降、および OpenGL ES 2 向けの技術が提供されています。

プロパティのドキュメント

ambient : QColor

周囲の色を保持します。

アクセス関数:

QColor ambient() const
void setAmbient(const QColor &ambient)

通知シグナル:

void ambientChanged(const QColor &ambient)

diffuse : QColor

拡散色を保持します。

アクセス関数:

QColor diffuse() const
void setDiffuse(const QColor &diffuse)

通知シグナル:

void diffuseChanged(const QColor &diffuse)

shininess : float

光沢指数を保持します。

アクセス関数:

float shininess() const
void setShininess(float shininess)

通知シグナル:

void shininessChanged(float shininess)

specular : QColor

スペキュラーカラーを保持します。

アクセス関数:

QColor specular() const
void setSpecular(const QColor &specular)

通知シグナル:

void specularChanged(const QColor &specular)

メンバ関数のドキュメント

[explicit] QPhongMaterial::QPhongMaterial(Qt3DCore::QNode *parent = nullptr)

親オブジェクトparent を持つ新しいQPhongMaterialインスタンスを作成します。

[virtual noexcept] QPhongMaterial::~QPhongMaterial()

QPhongMaterial を削除します。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.