This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Programming Quick Start


The primary goal of this quick start tutorial is to introduce you to programming basics in UNIGINE. Basically, this tutorial covers the C++ API workflow, however, the principles are almost the same for all programming workflows available in UNIGINE, as well as code snippets provided in this tutorial are available in C++, C# and UnigineScript. In the framework of this tutorial we are going to develop a Project which involves basic UNIGINE functionality (managing objects, lights, cameras; logging, console, intersections, controls, GUI, properties, etc). Upon the completion of this tutorial, you'll be able to solve the following tasks:

  1. The basic scene objects and coordinate system
  2. Logging and printing messages to console
  3. Saving and loading a world
  4. Closing the application
  5. Working with smart pointers
  6. Creating and deleting nodes at runtime
  7. Creating and setting up a camera
  8. Creating and setting up light sources
  9. Creating, applying and deleting materials at runtime
  10. Managing existing scene objects
  11. Performing basic transformations (move, rotate, scale)
  12. Making the application frame rate independent
  13. Managing intersections
  14. Getting and managing user inputs
  15. Implementing game logic and use properties
  16. Creating user interface

Tutorial Structure

For your convenience each of the sections of this tutorial is dedicated to solving a certain task (see the list above) and divided into two sub-parts:

  • Basic part - describing some basic examples of how to solve the task of the section, which can be used as a HOWTO.
  • Project Progress - giving a detailed description of solving the task of the section in the framework of the Project and a video.
  • Source Files - providing a source code that can be copied and pasted to the corresponding source files of your Project.
So, if you just need to find a quick answer to your question, you may look through the basic part.

Tutorial Project Design Requirements

Before we dive into developing our project let us describe the basic functions and appearance of our application.

Graphical user interface of the tutorial project application.

Our first UNIGINE application is going to have the following features:

  • One free-roaming camera.
  • Three light sources to light our scene: world, projected and omni.
  • Graphical user interface (see image above).
  • Moving and rotating the initial set of objects (4 colored boxes) and changing their scale once in 2 seconds.
  • Changing the time of the day in two modes:
    • automatic - if the corresponding checkbox is checked.
    • manual - by changing the slider position.
  • Loading a default world by clicking the "Load World" button.
  • Loading a mesh-file by clicking the "Load Mesh" button and performing the following actions:
    • Specifying the file in the File Open Dialog.
    • Setting the name and location coordinates for the object to be added to scene.
  • Closing the application if the "Quit" button was clicked or if "Q" key was pressed on the keyboard.
  • Selecting an object on the scene by clicking the right mouse button.
  • Highlighting currently selected object by changing its material to the default mesh_base (using property-based logic).
  • Deleting currently selected object (or all objects of the scene) using the "Delete" button and the combobox.

So, let's get started and make our first UNIGINE project!

START THE PROJECT >>

See Also

Last update: 2020-11-24
Build: ()