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

Basics

Camera Zoom#

This sample demonstrates a zoom and camera focus system that allows the user to inspect predefined targets in the scene and adjust the zoom level. Three info boards are placed throughout the scene, each with an in-world GUI panel showing its distance from the player and its dimensions. These panels update automatically in real time based on the player's position.

The user can select any target using dedicated UI buttons, prompting the camera to focus on the selected object.

Zoom is controlled via a slider that adjusts the camera’s field of view. As the FOV changes, related parameters such as mouse sensitivity and render distance scaling are adjusted as well to maintain a consistent experience. A reset button restores all values to default.

This setup is useful for scenarios that require object-focused viewing, such as inspection tools, scene walkthroughs, or any case where adjustable zoom and camera focus help users better understand or explore the scene.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/camera_zoom

Euler Angles#

Example of the object rotation using Euler angles. You can also observe different ways of decomposing the current rotation by various angle sequences.

This example helps to understand 3D rotations using Euler angles. It shows how different sequences can lead to different orientations in space.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/euler_angles

IFps Usage#

This sample demonstrates the importance of using Game.IFps to implement movement logic independent of the frame rate.

The sample features two cubes moving back and forth along the X-axis. Their movement is implemented in the IFpsMovementController file. Use the Max FPS slider to change the target frame rate.

The green cube uses Game.IFps to scale its movement by the frame time delta. This ensures consistent speed across varying frame rates.

The red cube does not use Game.IFps and simply applies constant translation per frame, which results in inconsistent behavior when frame rate changes

This sample demonstrates why using time-based logic is essential for consistent results at different frame rates.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/ifps_usage

Intersection Bound Box#

This sample demonstrates how to find an intersection between the bound box and geometry.

The BoundBoxIntersection.cs component shows how to use World.GetIntersection() to detect static mesh objects located within a specified world-space axis-aligned bounding box. The box is highlighted using the Visualizer, and intersected object names are printed to the onscreen console overlay.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/intersection_bound_box

Intersection Bound Frustum#

This sample demonstrates how to find an intersection between the bound frustum and geometry.

The BoundFrustumIntersection.cs component shows how to use World.GetIntersection() to detect static mesh objects located inside a perspective frustum defined in world coordinates. The frustum is highlighted using the Visualizer, and intersected object names are printed to the onscreen console overlay.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/intersection_bound_frustum

Intersection Bound Sphere#

This sample demonstrates how to find an intersection between the bound sphere and geometry.

The BoundSphereIntersection.cs component shows how to use World.GetIntersection() to detect static mesh objects located within a spherical volume defined in world coordinates. The sphere is highlighted using the Visualizer, and intersected object names are printed to the onscreen console overlay.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/intersection_bound_sphere

Intersection Mouse Ray#

This sample demonstrates how to find an intersection between a ray cast from the camera through the mouse cursor and geometry.

The MouseRayIntersection.cs component shows how to use World.GetIntersection() to detect static mesh objects intersected by a ray cast from the player's position in the direction pointed by the mouse cursor. The name of the hit object is displayed next to the cursor on the screen.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/intersection_mouse_ray

Intersection Ray#

This sample demonstrates how to find an intersection of a ray with geometry.

The LaserRayIntersection.cs component casts a ray from the laser origin in its forward direction and uses World.GetIntersection() to detect intersections with geometry. The method provides both the intersection point and the surface normal. Intersected object names are printed to the onscreen console overlay.

If a hit is detected, the laser beam is resized to visually represent the exact distance between its origin and the intersection point. The hit effect object is shown at the intersection point, oriented in accordance with the surface normal. If no intersection is found, the laser beam keeps its default length and the effect remains hidden.


SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/intersection_ray

World Local Transformation#

This sample demonstrates the difference between local and world transformations.
SDK Path: <SDK_INSTALLATION>data/csharp_component_samples/basic/transform_world_local

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

Last update: 2025-06-30
Build: ()