This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Programming Quick Start

Prior Knowledge
This Tutorial assumes you have prior knowledge of the following topics. Please read them before proceeding:


The primary goal of this quick start tutorial is to introduce you to C++ programming basics in UNIGINE. 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. What are the basic scene objects and coordinate system?
  2. How to log and print messages to console?
  3. How to save and load a world?
  4. How to close the application?
  5. How to work with smart pointers?
  6. How to create and delete nodes at runtime?
  7. How to create and set up a camera?
  8. How to create and set up light sources?
  9. How to create, apply and delete materials at runtime?
  10. How to manage existing scene objects?
  11. How to perform basic transformations (move, rotate, scale)?
  12. How to make your application frame rate independent?
  13. How to manage intersections?
  14. How to get and manage user inputs?
  15. How to implement game logic and use properties?
  16. How to create 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 sections starting from 6 are 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 >>

Last update: 2018-08-10
Build: ()