Class SceneView

    Definition

    Namespace:
    Tizen.NUI.Scene3D
    Assembly:
    Tizen.NUI.Scene3D.dll

    SceneView is a Class to show multiple 3D objects in a single 2D screen. Each SceneView has its own 3D space, and 3D objects added to SceneView are positioned in the space. SceneView uses left-handed coordinate system same as NUI. X as right, Y as down, and Z as forward.

    SceneView has internal root container to control inner rendering process like depth test. When a View is added to the SceneView with Add(View) method, it is actually added on the root container. Therefore, the added Views exist in the sub tree of SceneView, but are not direct children. The sub tree of Views will be rendered with the SceneView's own Camera.

    SceneView has one built-in camera by default. The default Camera is not removed by using RemoveCamera(Camera) method. GetCamera(uint) method with index "0" returns the default camera, and the minimum value returned by GetCameraCount() method is 1.

    SceneView also provides multiple Camera and one of them can be used to render multiple objects. AddCamera(Camera), RemoveCamera(Camera), GetCamera(uint), and SelectCamera(uint) are methods to manage Cameras of the SceneView. User can place multiple cameras in a scene to display the entire scene or to display individual objects. User can use the SelectCamera(uint) method to select the currently required camera.

    When the SceneView's size changes, some camera properties that depend on its size may also change. The changing properties are as follows: AspectRatio, LeftPlaneDistance, RightPlaneDistance, TopPlaneDistance, and BottomPlaneDistance. The Camera's FieldOfView is vertical fov. The horizontal fov is updated internally according to the SceneView size.

    The SetImageBasedLightSource(string, string, float) method sets the same IBL to all Model objects added to the SceneView. For the IBL, two cube map textures(diffuse and specular) are required. SceneView supports 4 types layout for Cube Map: Vertical/Horizontal Cross layouts, and Vertical/Horizontal Array layouts. And also, ktx format with cube map is supported. If a model already has an IBL, it is batch overridden with the IBL of the SceneView. If the SceneView has IBL, the IBL of newly added models is also overridden.

    The IBL textures start to be loaded asynchronously when SetImageBasedLightSource(string, string, float) method is called. ResourcesLoaded signal notifies that the loading of the IBL resources have been completed.

    If FBO is used, the rendering result of SceneView is drawn on the FBO and it is mapped on the plane of the SceneView. It could decreases performance slightly, but it is useful to show SceneView according to the rendering order with other Views.

    And since SceneView is a View, it can be placed together with other 2D UI components in the NUI window.

    public class SceneView : View, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider
    Inheritance
    object
    BindableObject
    Element
    BaseHandle
    Animatable
    Container
    View
    SceneView
    Implements
    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Constructors

    View Source

    SceneView()

    Create an initialized SceneView.

    Declaration
    public SceneView()
    View Source

    SceneView(SceneView)

    Copy constructor.

    Declaration
    public SceneView(SceneView sceneView)
    Parameters
    Type Name Description
    SceneView sceneView

    The source object.

    Properties

    View Source

    FramebufferMultiSamplingLevel

    Set/Get the Framebuffer's MultiSamplingLevel. Only has effects if UseFramebuffer is true, and Framebuffer MultiSampling is supported. Default is 0.

    Declaration
    public uint FramebufferMultiSamplingLevel { get; set; }
    Property Value
    Type Description
    uint
    Remarks

    Getter didn't consider Framebuffer MultiSampling is supported or not.

    View Source

    ImageBasedLightScaleFactor

    Set/Get the ImageBasedLight ScaleFactor. Scale factor controls light source intensity in [0.0f, 1.0f]

    Declaration
    public float ImageBasedLightScaleFactor { get; set; }
    Property Value
    Type Description
    float
    View Source

    SkyboxIntensity

    Set/Get Skybox intensity. The skybox intensity is multiplied to the color of skybox texture. Default value is 1.0f.

    Declaration
    public float SkyboxIntensity { get; set; }
    Property Value
    Type Description
    float
    View Source

    SkyboxOrientation

    Set/Get angle of orientation of the skybox. If orientation is set, the skybox will be rotate by the Radian orientation along YAxis. Default value is 0.0f.

    Declaration
    public Rotation SkyboxOrientation { get; set; }
    Property Value
    Type Description
    Rotation
    View Source

    SkyboxUrl

    Set/Get SkyboxUrl. If SkyboxUrl is set, the cube map image is loaded and skybox is attached on scene. Skybox texture is asynchronously loaded. When loading is finished, ResourcesLoaded is emitted.

    Declaration
    public string SkyboxUrl { get; set; }
    Property Value
    Type Description
    string
    View Source

    UseFramebuffer

    Set/Get the UseFramebuffer. If this property is true, rendering result of SceneView is drawn on FBO and it is mapping on this SceneView plane. If this property is false, each item in SceneView is rendered on window directly. Default is false.

    Declaration
    public bool UseFramebuffer { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    If UseFramebuffer is true, it could decrease performance but entire rendering order is satisfied. If UseFramebuffer is false, the performance becomes better but SceneView is rendered on the top of the other 2D components regardless tree order.

    Methods

    View Source

    AddCamera(Camera)

    Adds a Camera to the SceneView at the end of the camera list of SceneView. The Camera can be used as a selected camera to render the scene by using SelectCamera(uint) or SelectCamera(string)

    Declaration
    public void AddCamera(Camera camera)
    Parameters
    Type Name Description
    Camera camera

    Camera added on this SceneView.

    Remarks

    Some properties of the Camera will be change depending on the Size of this SceneView. Those properties are as follows: AspectRatio, LeftPlaneDistance, RightPlaneDistance, TopPlaneDistance, and BottomPlaneDistance.

    The FieldOfView of Camera is for vertical fov. When the size of the SceneView is changed, the vertical fov is maintained and the horizontal fov is automatically calculated according to the SceneView's AspectRatio.

    View Source

    CameraTransition(string, int, AlphaFunction)

    Starts camera transition from currently selected camera to a camera of input name. Camera Position, Orientation and FieldOfView are smoothly animated.

    Declaration
    public void CameraTransition(string name, int durationMilliSeconds, AlphaFunction alphaFunction = null)
    Parameters
    Type Name Description
    string name

    string keyword of destination Camera of Camera transition.

    int durationMilliSeconds

    The duration in milliseconds.

    AlphaFunction alphaFunction

    The alpha function to apply.

    Remarks

    The selected camera is switched to the Camera of the input name when the transition is finished. During camera transition, Selected Camera should not be changed by using SelectCamera() or CameraTransition() method. During camera transition, Camera properties of Selected Camera should not be changed.

    View Source

    CameraTransition(uint, int, AlphaFunction)

    Starts camera transition from currently selected camera to a camera of index. Camera Position, Orientation and FieldOfView are smoothly animated.

    Declaration
    public void CameraTransition(uint index, int durationMilliSeconds, AlphaFunction alphaFunction = null)
    Parameters
    Type Name Description
    uint index

    Index of destination Camera of Camera transition.

    int durationMilliSeconds

    The duration in milliseconds.

    AlphaFunction alphaFunction

    The alpha function to apply.

    Remarks

    The selected camera is switched to the Camera of the index when the transition is finished. During camera transition, Selected Camera should not be changed by using SelectCamera() or CameraTransition() method. During camera transition, Camera properties of Selected Camera should not be changed.

    View Source

    Capture(Camera, Vector2)

    Requests to capture this SceneView with the Camera. When the capture is finished, CaptureFinished Event is emited. CaptureFinishedEventArgs includes CaptureId and CapturedImageUrl. If the capture is successful, the CapturedImageUrl contains url of captured image. If the capture fails, the CapturedImageUrl is null.

    Declaration
    public int Capture(Camera camera, Vector2 size)
    Parameters
    Type Name Description
    Camera camera

    Camera to be used for capture.

    Vector2 size

    captured size.

    Returns
    Type Description
    int

    capture id that id unique value to distinguish each requiest.

    Remarks

    The input camera should not be used for any other purpose during Capture. (Simultaneous usage elsewhere may result in incorrect rendering.) The camera is required to be added in this SceneView. (Not need to be a selected camera) If the SceneView is disconnected from Scene, the left capture requests are canceled with fail.

    View Source

    CaptureAsync(Camera, Vector2)

    Requests to capture this SceneView with the Camera asynchronously.

    Declaration
    public Task<ImageUrl> CaptureAsync(Camera camera, Vector2 size)
    Parameters
    Type Name Description
    Camera camera

    Camera to be used for capture.

    Vector2 size

    captured size.

    Returns
    Type Description
    Task<><ImageUrl>

    A task that represents the asynchronous operation. The task result contains the URL of the captured image. If the capture is successful, the task result is the ImageURL. If the capture fails, the task will complete with an

    Remarks

    The input camera should not be used for any other purpose during Capture. (Simultaneous usage elsewhere may result in incorrect rendering.) The camera is required to be added in this SceneView. (Not need to be a selected camera) If the SceneView is disconnected from Scene, the left capture requests are canceled with fail.

    View Source

    Dispose(DisposeTypes)

    Dispose Explicit or Implicit

    Declaration
    protected override void Dispose(DisposeTypes type)
    Parameters
    Type Name Description
    DisposeTypes type
    Overrides
    View.Dispose(DisposeTypes)
    View Source

    GetCamera(string)

    Retrieves a Camera of the input name.

    Declaration
    public Camera GetCamera(string name)
    Parameters
    Type Name Description
    string name

    string keyword of Camera to be retrieved.

    Returns
    Type Description
    Camera

    Camera that has the name as a View.Name property

    View Source

    GetCamera(uint)

    Retrieves a Camera of the index.

    Declaration
    public Camera GetCamera(uint index)
    Parameters
    Type Name Description
    uint index

    Index of Camera to be retrieved.

    Returns
    Type Description
    Camera

    Camera of the index.

    View Source

    GetCameraCount()

    Retrieves the number of cameras.

    Declaration
    public uint GetCameraCount()
    Returns
    Type Description
    uint

    The number of Cameras.

    View Source

    GetResolutionHeight()

    Retrieves height of resolution of the SceneView.

    Declaration
    public uint GetResolutionHeight()
    Returns
    Type Description
    uint

    Height of the SceneView resolution.

    Remarks

    If the SceneView not uses FBO, this method returns SceneView's height.

    View Source

    GetResolutionWidth()

    Retrieves width of resolution of the SceneView.

    Declaration
    public uint GetResolutionWidth()
    Returns
    Type Description
    uint

    Width of the SceneView resolution

    Remarks

    If the SceneView not uses FBO, this method returns SceneView's width.

    View Source

    GetSelectedCamera()

    Retrieves selected Camera.

    Declaration
    public Camera GetSelectedCamera()
    Returns
    Type Description
    Camera

    Camera currently used in SceneView as a selected Camera.

    View Source

    ReleaseSwigCPtr(HandleRef)

    Release swigCPtr.

    Declaration
    protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
    Parameters
    Type Name Description
    System.Runtime.InteropServices.HandleRef swigCPtr
    View Source

    RemoveCamera(Camera)

    Removes a Camera from this SceneView. If removed Camera is selected Camera, first camera in the list becomes the selected Camera.

    Declaration
    public void RemoveCamera(Camera camera)
    Parameters
    Type Name Description
    Camera camera

    camera Camera to be removed from this Camera.

    Remarks

    When Camera.Dispose() is called, the NUI object is disposed, but camera information is maintained internally. Therefore, even if Camera.Dispose() is called, RemoveCamera() or RemoveCamera() methods can be used. If RemoveCamera() is called too, all information is deleted together.

    View Source

    ResetResolution()

    Resets SceneView's resolution to the current size of SceneView.

    Declaration
    public void ResetResolution()
    View Source

    SelectCamera(string)

    Makes SceneView use a Camera of a name as a selected camera.

    Declaration
    public void SelectCamera(string name)
    Parameters
    Type Name Description
    string name

    string keyword of Camera to be used as a selected camera.

    View Source

    SelectCamera(uint)

    Makes SceneView use a Camera of index as a selected camera.

    Declaration
    public void SelectCamera(uint index)
    Parameters
    Type Name Description
    uint index

    Index of Camera to be used as a selected camera.

    View Source

    SetImageBasedLightSource(string, string, float)

    Changes Image Based Light as the input textures.

    Declaration
    public void SetImageBasedLightSource(string diffuseUrl, string specularUrl, float scaleFactor = 1)
    Parameters
    Type Name Description
    string diffuseUrl

    The path of Cube map image that can be used as a diffuse IBL source.

    string specularUrl

    The path of Cube map image that can be used as a specular IBL source.

    float scaleFactor

    Scale factor that controls light source intensity in [0.0f, 1.0f]. Default value is 1.0f.

    Remarks

    http://tizen.org/privilege/mediastorage for local files in media storage. http://tizen.org/privilege/externalstorage for local files in external storage.

    View Source

    SetResolution(uint, uint)

    Sets SceneView's resolution manually.

    Declaration
    public void SetResolution(uint width, uint height)
    Parameters
    Type Name Description
    uint width

    The input width.

    uint height

    The input height.

    Remarks

    This manual resolution is only available when the SceneView uses FBO for rendering by using FBO (UseFrameBuffer is true). If the aspect ratio of input width/height is different with SceneView's aspect ratio, the rendered result is stretched to fill SceneView's area.

    Events

    View Source

    CameraTransitionFinished

    An event emitted when Camera Transition is finished.

    Declaration
    public event EventHandler CameraTransitionFinished
    Event Type
    Type Description
    EventHandler
    View Source

    CaptureFinished

    An event emitted when Capture is finished. If Capture is successed, CaptureFinishedEventArgs includes finished capture ID and ImageUrl of the captured image. If Capture is failed, the ImageUrl is null.

    Declaration
    public event EventHandler<CaptureFinishedEventArgs> CaptureFinished
    Event Type
    Type Description
    EventHandler<><CaptureFinishedEventArgs>

    Implements

    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Extension Methods

    ViewExtensions.BackgroundColor(View)
    ViewExtensions.BorderlineColor(View)
    ViewExtensions.BoxShadow(View)
    ViewExtensions.Color(View)
    ViewExtensions.CornerRadius(View)
    SceneViewExtension.EnableCropToMask(SceneView, bool)
    SceneViewExtension.GetAlphaMaskUrl(SceneView)
    SceneViewExtension.GetMaskContentScaleFactor(SceneView)
    SceneViewExtension.IsEnabledCropToMask(SceneView)
    SceneViewExtension.SetAlphaMaskUrl(SceneView, string)
    SceneViewExtension.SetMaskContentScaleFactor(SceneView, float)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    ViewExtensions.BackgroundColor<T>(T, float, float, float, float)
    ViewExtensions.BackgroundColor<T>(T, uint, float)
    ViewExtensions.BackgroundColor<T>(T, UIColor)
    ViewExtensions.BackgroundImage<T>(T, string)
    ViewExtensions.Borderline<T>(T, float, UIColor, float)
    ViewExtensions.BorderlineColor<T>(T, float, float, float, float)
    ViewExtensions.BorderlineColor<T>(T, uint, float)
    ViewExtensions.BorderlineColor<T>(T, UIColor)
    ViewExtensions.BorderlineOffset<T>(T, float)
    ViewExtensions.BorderlineWidth<T>(T, float)
    ViewExtensions.BoxShadow<T>(T, float, float, float)
    ViewExtensions.BoxShadow<T>(T, float, UIColor, float, float)
    ViewExtensions.BoxShadow<T>(T, UIShadow)
    ViewExtensions.ClippingMode<T>(T, ClippingModeType)
    ViewExtensions.Color<T>(T, float, float, float, float)
    ViewExtensions.Color<T>(T, uint, float)
    ViewExtensions.Color<T>(T, UIColor)
    ViewExtensions.CornerRadius<T>(T, float, bool)
    ViewExtensions.CornerRadius<T>(T, float, float, float, float, bool)
    ViewExtensions.CornerRadius<T>(T, UICorner)
    ViewExtensions.Focusable<T>(T, bool)
    ViewExtensions.FocusableChildren<T>(T, bool)
    ViewExtensions.FocusableInTouch<T>(T, bool)
    ViewExtensions.ImageShadow<T>(T, ImageShadow)
    ViewExtensions.IsEnabled<T>(T, bool)
    ViewExtensions.Layout<T>(T, LayoutItem)
    ViewExtensions.Opacity<T>(T, float)
    ViewExtensions.Position<T>(T, float, float)
    ViewExtensions.PositionX<T>(T, float)
    ViewExtensions.PositionY<T>(T, float)
    ViewExtensions.Scale<T>(T, float, float)
    ViewExtensions.ScaleX<T>(T, float)
    ViewExtensions.ScaleY<T>(T, float)
    ViewExtensions.Sensitive<T>(T, bool)
    ViewExtensions.Size<T>(T, float, float)
    ViewExtensions.SizeHeight<T>(T, float)
    ViewExtensions.SizeWidth<T>(T, float)
    ViewExtensions.Visibility<T>(T, bool)
    ViewExtensions.VoiceInteractionName<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX