Skip to content
bg2 engine

TypeScript Tutorials

This section contains a set of step-by-step tutorials designed to help you understand how to build applications using the bg2 engine TypeScript API. The tutorials progress from basic concepts to more advanced topics, covering the typical workflow of a web-based 3D application.

Each tutorial focuses on a specific aspect of the engine and can be followed independently, although it is recommended to go through them in order for a smoother learning experience.

  • Basic Structure
    Introduces the minimal setup required to run a bg2 engine application, including canvas creation, main loop initialization, and application controller structure.

  • Scene App Controller
    Explains how to structure an application around a scene-based controller, separating rendering logic from application lifecycle management.

  • Scenes from scratch
    Covers scene creation, node hierarchy, and how to organize objects within the scene graph.

  • React Integration
    Describes how to integrate the engine with React applications, focusing on coordinating UI state with the rendering lifecycle.

  • Components
    Introduces the component system, showing how to extend node behavior and encapsulate functionality.

  • Selection
    Explains how to implement object selection mechanisms, typically based on ID rendering or similar techniques.