Skip to content

add_scene_3d_lightAddScene3dLightAddScene3dLightadd_scene_3d_lightT_add_scene_3d_light🔗

Short description🔗

add_scene_3d_lightAddScene3dLightAddScene3dLightadd_scene_3d_lightT_add_scene_3d_light — Add a light source to a 3D scene.

Signature🔗

add_scene_3d_light( scene_3d Scene3D, real LightPosition, string LightKind, out integer LightIndex )void AddScene3dLight( const HTuple& Scene3D, const HTuple& LightPosition, const HTuple& LightKind, HTuple* LightIndex )static void HOperatorSet.AddScene3dLight( HTuple scene3D, HTuple lightPosition, HTuple lightKind, out HTuple lightIndex )def add_scene_3d_light( scene_3d: HHandle, light_position: Sequence[Union[int, float]], light_kind: str ) -> int

Herror T_add_scene_3d_light( const Htuple Scene3D, const Htuple LightPosition, const Htuple LightKind, Htuple* LightIndex )

Hlong HScene3D::AddScene3dLight( const HTuple& LightPosition, const HString& LightKind ) const

Hlong HScene3D::AddScene3dLight( const HTuple& LightPosition, const char* LightKind ) const

Hlong HScene3D::AddScene3dLight( const HTuple& LightPosition, const wchar_t* LightKind ) const (Windows only)

int HScene3D.AddScene3dLight( HTuple lightPosition, string lightKind )

Description🔗

add_scene_3d_lightAddScene3dLight adds a new light source to the scene Scene3Dscene3Dscene_3d and returns its index in LightIndexlightIndexlight_index. The kind of the light source must be specified in LightKindlightKindlight_kind. For LightKindlightKindlight_kind = 'point_light'"point_light", LightPositionlightPositionlight_position is interpreted as the position of the light source. For LightKindlightKindlight_kind = 'directional_light'"directional_light", LightPositionlightPositionlight_position is interpreted as the vector of the directional light source.

Currently only one light source is supported, such that add_scene_3d_lightAddScene3dLight overwrites the existing light source. This may be changed in future versions.

If no light source is set, a point light source at [-100.0, -100.0, 0.0] is used.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Scene3Dscene3Dscene_3d (input_control) scene_3d → (handle)HTuple (HHandle)HScene3D, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the 3D scene.

LightPositionlightPositionlight_position (input_control) real-array → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

Position of the new light source.

Default: [-100.0, -100.0, 0.0][-100.0, -100.0, 0.0]

LightKindlightKindlight_kind (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Type of the new light source.

Default: 'point_light'"point_light"
List of values: 'directional_light', 'point_light'"directional_light", "point_light"

LightIndexlightIndexlight_index (output_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Index of the new light source in the 3D scene.

Result🔗

add_scene_3d_lightAddScene3dLight returns 2 (H_MSG_TRUE) if all parameters are correct. If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

create_scene_3dCreateScene3d

Possible successors

set_scene_3d_light_paramSetScene3dLightParam

See also

remove_scene_3d_lightRemoveScene3dLight

Module🔗

3D Metrology