Run the DirectX Sample

This section walks you through how to set up and run the DirectX Sample on a local environment. Seeing how it works will help you understand how we integrate the SDK with this application and what you need to do with your own project.

Overview

The Cube Sample displays 3 cubes named Athos, Porthos, and Aramis. The cubes rotate and move in different fixed directions. When a cube reaches an edge, it moves to the opposite side of the world to continue its movement without interruption. The player controls one cube at a time using these controls:

  • The arrow and W A S D keys change the trajectory of the selected cube.
    Modifying the direction also affects the rotation of the object.
  • The 1, 2, and 3 keys select different cubes.
  • The numeric keypad keys change the selected cube’s color.
  • The 0 key resets the orientation of the selected cube.
  • The P key resets the position of the selected cube.
  • The Backspace key stops the cube from moving.

Before You Begin

  1. Download and install the latest GenvidSDK.
  2. Install the Genvid Toolbox scripts.
  3. Install the Genvid supervisor services.

Run the DirectX Application

  1. Clean and load the project configuration.

    genvid-sdk setup # Make sure the local cluster is created.
    genvid-sdk clean-config # Clean old config in case of existing cluster.
    genvid-sdk load-config-sdk # Configure the basic services for the SDK.
    
  2. Go to the /samples/cube/web directory.

  3. Generate and load the cube web sample to be able to view the streaming session.

    py web.py build
    py web.py load
    
  4. Go to the /samples/cube/directx directory.

  5. Copy the Genvid files used to build the project.

    py directx.py prepare
    
  6. Build the project and the website.

    py directx.py build
    
  7. Load the DirectX configuration.

    py directx.py load
    
  8. Launch the Cluster UI.

    genvid-sdk monitor
    
  9. Click the Jobs tab.

  10. Click START ALL.

    This starts the following jobs:

    • services
    • directx application
    • web

    You can also start the services individually.

    The links become active after the job status changes to running.

  11. Click CUBE SAMPLE in the Links section to launch the website.

  12. When finished, click STOP ALL to stop all the services.