Skip to content

create_scene_3dCreateScene3dCreateScene3dcreate_scene_3dT_create_scene_3dπŸ”—

Short descriptionπŸ”—

create_scene_3dCreateScene3dCreateScene3dcreate_scene_3dT_create_scene_3d β€” Create the data structure that is needed to visualize collections of 3D objects.

SignatureπŸ”—

create_scene_3d( out scene_3d Scene3D )void CreateScene3d( HTuple* Scene3D )static void HOperatorSet.CreateScene3d( out HTuple scene3D )def create_scene_3d( ) -> HHandle

Herror T_create_scene_3d( Htuple* Scene3D )

void HScene3D::HScene3D( )

public HScene3D( )

void HScene3D::CreateScene3d( )

void HScene3D.CreateScene3d( )

DescriptionπŸ”—

create_scene_3dCreateScene3d creates a new 3D scene and returns it in Scene3Dscene3Dscene_3d.

A 3D scene is a collection of instances of 3D object models, cameras, and light sources. Use the operators add_scene_3d_instanceAddScene3dInstance, add_scene_3d_cameraAddScene3dCamera, and add_scene_3d_lightAddScene3dLight to add these objects to Scene3Dscene3Dscene_3d. Use display_scene_3dDisplayScene3d to display a 3D scene in a window.

A pose is associated (with add_scene_3d_instanceAddScene3dInstance or set_scene_3d_instance_poseSetScene3dInstancePose) to each instance in the Scene, which represents the instance’s position within the scene coordinate system SCS. The pose of the scene in the world coordinate system WCS can be set with set_scene_3d_to_world_poseSetScene3dToWorldPose. The pose of the camera in the world coordinate system can be set with set_scene_3d_camera_poseSetScene3dCameraPose and defines the camera coordinate system CCS.

The coordinate systems in a 3D scene

Parameters influencing the whole scene such as the quality of the rendering can be set with set_scene_3d_paramSetScene3dParam.

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.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

ParametersπŸ”—

Scene3Dscene3Dscene_3d (output_control) scene_3d β†’ (handle)HTuple (HHandle)HScene3D, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the 3D scene.

ExampleπŸ”—

(HDevelop)

  * Create a new scene
  create_scene_3d (Scene)
  * A scene needs at least one camera. The default pose
  * of a camera is located at the origin. The pose can be
  * changed with set_scene_3d_camera_pose.
  add_scene_3d_camera (Scene, CameraParam, CameraIndex)
  * Further a scene needs at least one light.
  add_scene_3d_light (Scene, [42.0, 42.0, 42.0], 'point_light', LightIndex)
  *
  * To add an object, add_scene_3d_instance is called with a
  * 3d object model and a pose. add_scene_3d returns an InstanceIndex
  * which must be used to reference this instance in subsequent calls.
  add_scene_3d_instance (Scene, ObjectModel3D, Pose, InstanceIndex)
  * Set its color.
  set_scene_3d_instance_param (Scene, InstanceIndex, 'color', 'green')
  * Display the scene.
  display_scene_3d (WindowHandle, Scene, CameraIndex)
  clear_scene_3d (Scene)

ResultπŸ”—

create_scene_3dCreateScene3d returns 2 (H_MSG_TRUE) if the scene could be created successfully. If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

add_scene_3d_instanceAddScene3dInstance, add_scene_3d_lightAddScene3dLight, add_scene_3d_cameraAddScene3dCamera, set_scene_3d_paramSetScene3dParam

See also

clear_scene_3dClearScene3d

ModuleπŸ”—

3D Metrology