This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Cameras

The Camera section of the C# Component Samples demo contains a set of samples demonstrating how to set and adjust a camera for various use cases:

This sample demonstrates a first-person spectator-style camera with free movement.

The CameraSpectator.cs component provides free-flight first-person controls by modifying the position and orientation of a PlayerDummy node in real time. The movement and rotation are handled via the CameraControls.cs component that defines directional input.

The camera moves in six directions (forward, backward, left, right, up, down) and rotates using pitch and yaw angles. The Speed and Angular Speed parameters can be adjusted in the component properties to control the camera's movement and rotation responsiveness.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_first_person


SDK Path: <SDK_INSTALLATION>

This sample demonstrates an orbital camera rotating around a target.

The CameraOrbit.cs component enables orbit-style camera movement around a target object using a PlayerDummy node. Input is handled via the CameraControls.cs component, which provides configurable input controls for camera movement and zoom.

The camera behavior can be customized using the exposed parameters: Angular Speed, Zoom Speed, Min/Max Distance, and Min/Max Vertical Angle. The Target field defines the object the camera orbits around.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_orbit

This sample demonstrates a camera moving parallel to the screen plane using the CameraPanning.cs component assigned to a PlayerDummy node.

The CameraPanning.cs component implements a free panning camera that allows movement along the view plane, rotation, and zoom based on mouse input.

The camera position can be adjusted by dragging the scene, and rotation is enabled by holding the right mouse button. Zooming is controlled with the mouse wheel. The responsiveness of movement and rotation is configurable via the Default Linear Speed, Mouse Sensitivity, and Mouse Wheel Sensitivity parameters in the component properties.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_panning

This sample demonstrates a camera following a moving target.

The CameraPersecutor.cs component implements a third-person follow camera that smoothly tracks a moving target defined in the Target field. The camera adjusts its distance, pitch, and yaw to maintain the desired view of the target, using the PlayerDummy node as its base.

Input is handled via the CameraControls.cs component and allows orbiting around the target as well as zooming in and out. The behavior is configurable through parameters such as Angular Speed, Zoom Speed, Min/Max Distance, Min/Max Vertical Angle, and the Use Fixed Angles toggle. The Target field can be manually assigned and defines the object the camera will follow.

The target movement is defined by the CameraPersecutorTarget.cs component, which moves the object along a circular path over time to demonstrate dynamic tracking.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/complex/camera_persecutor


SDK Path: <SDK_INSTALLATION>

Accessing Demo Source Code#

You can study and modify the source code of this demo to create your own projects. To access the source code do the following:

  1. Find the C# Component Samples demo in the Demos section and click Install (if you haven't installed it yet).
  2. After successful installation the demo will appear in the Installed section, and you can click Copy as Project to create a project based on this demo.
  3. In the Create New Project window, that opens, enter the name for your new project in the corresponding field and click Create New Project.
  4. Now you can click Open Code IDE to check and modify source code in your default IDE, or click Open Editor to open the project in the UnigineEditor.

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2024-12-13
Build: ()