Class: QgsPointLightSettings

Definition of a point light in a 3D map scene.

Total light at the distance D from a point light with intensity I is (I / TA) where TA is total attenuation which is calculated as (A_0 + A_1 * D + A_2 * D^2). The terms A_0, A_1 and A_2 stand for constant, linear and quadratic attenuation.

Added in version 3.6.

Class Hierarchy

Inheritance diagram of qgis._3d.QgsPointLightSettings

Base classes

QgsLightSource

Base class for light sources in 3d scenes.

Methods

color

Returns color of the light

constantAttenuation

Returns constant attenuation (A_0)

intensity

Returns intensity of the light

linearAttenuation

Returns linear attenuation (A_1)

position

Returns position of the light (in 3D world coordinates)

quadraticAttenuation

Returns quadratic attenuation (A_2)

setColor

Sets color of the light

setConstantAttenuation

Sets constant attenuation (A_0)

setIntensity

Sets intensity of the light

setLinearAttenuation

Sets linear attenuation (A_1)

setPosition

Sets position of the light (in 3D world coordinates)

setQuadraticAttenuation

Sets quadratic attenuation (A_2)

class qgis._3d.QgsPointLightSettings[source]

Bases: QgsLightSource

__init__()

Construct a point light with default values

__init__(a0: QgsPointLightSettings)
Parameters:

a0 (QgsPointLightSettings)

color(self) QColor[source]

Returns color of the light

Return type:

QColor

constantAttenuation(self) float[source]

Returns constant attenuation (A_0)

Return type:

float

intensity(self) float[source]

Returns intensity of the light

Return type:

float

linearAttenuation(self) float[source]

Returns linear attenuation (A_1)

Return type:

float

position(self) QgsVector3D[source]

Returns position of the light (in 3D world coordinates)

Return type:

QgsVector3D

quadraticAttenuation(self) float[source]

Returns quadratic attenuation (A_2)

Return type:

float

setColor(self, color: QColor | Qt.GlobalColor)[source]

Sets color of the light

Parameters:

color (Union[QColor, Qt.GlobalColor])

setConstantAttenuation(self, value: float)[source]

Sets constant attenuation (A_0)

Parameters:

value (float)

setIntensity(self, intensity: float)[source]

Sets intensity of the light

Parameters:

intensity (float)

setLinearAttenuation(self, value: float)[source]

Sets linear attenuation (A_1)

Parameters:

value (float)

setPosition(self, pos: QgsVector3D)[source]

Sets position of the light (in 3D world coordinates)

Parameters:

pos (QgsVector3D)

setQuadraticAttenuation(self, value: float)[source]

Sets quadratic attenuation (A_2)

Parameters:

value (float)