Class: QgsPointLightSettings

class qgis.3d.QgsPointLightSettings

Bases: sip.wrapper

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.

New in version 3.6.

QgsPointLightSettings() Construct a point light with default values

QgsPointLightSettings(QgsPointLightSettings)

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)

readXml

Reads configuration from a DOM element previously written using writeXml()

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)

writeXml

Writes configuration to a new DOM element and returns it

color(self) QColor

Returns color of the light

Return type

QColor

constantAttenuation(self) float

Returns constant attenuation (A_0)

Return type

float

intensity(self) float

Returns intensity of the light

Return type

float

linearAttenuation(self) float

Returns linear attenuation (A_1)

Return type

float

position(self) QgsVector3D

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

Return type

QgsVector3D

quadraticAttenuation(self) float

Returns quadratic attenuation (A_2)

Return type

float

readXml(self, elem: QDomElement)

Reads configuration from a DOM element previously written using writeXml()

Parameters

elem (QDomElement) –

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

Sets color of the light

Parameters

color (Union[QColor) –

setConstantAttenuation(self, value: float)

Sets constant attenuation (A_0)

Parameters

value (float) –

setIntensity(self, intensity: float)

Sets intensity of the light

Parameters

intensity (float) –

setLinearAttenuation(self, value: float)

Sets linear attenuation (A_1)

Parameters

value (float) –

setPosition(self, pos: QgsVector3D)

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

Parameters

pos (QgsVector3D) –

setQuadraticAttenuation(self, value: float)

Sets quadratic attenuation (A_2)

Parameters

value (float) –

writeXml(self, doc: QDomDocument) QDomElement

Writes configuration to a new DOM element and returns it

Parameters

doc (QDomDocument) –

Return type

QDomElement