User Tools

Site Tools


tutorials:legacy:python_panda3d:getting_started_1_hello_world

This binding has been deprecated - please see the most recent release notes for more information.

Getting Started I (Hello World)

Introduction

In this tutorial you will prepare your development environment for use with the Python bindings for Gestureworks Core. While no code will be written in this tutorial, the steps performed here will prepare your environment for subsequent Gestureworks Core Python tutorials. For this tutorial you will need the Gestureworks Core multitouch framework; a free trial is available.

Download the code for all of the Python & Panda3D multitouch tutorials here: tutorials_python_panda3d.zip

Gestureworks Core "Bindings"

The various bindings included with Gestureworks Core allow a developer to create multitouch applications using their preferred language and framework, and are essentially mini-APIs providing an interface to the functions exported by the native Gestureworks Core library (GestureworksCore32.dll or GestureworksCore64.dll). Source code for each of the bindings is included so that you may extend or modify them as you like, as well as providing a blueprint for creating bindings for other languages or frameworks.

Python and Panda3D

Python-logo.png

The Python bindings for Gestureworks Core can be used by any Python project. The source code for the Python bindings is provided for portability and extensibility, but can be used quite effectively as-is in most situations.

Panda-logo-caption.png

Panda3D first originated at Disney, and is still used for their commercial games. From panda3d.org:

Panda3D is a game engine, a framework for 3D rendering and game development for Python and C++ programs. Panda3D is Open Source and free for any purpose, including commercial ventures, thanks to its liberal license.

For more information about Panda3D, please check out their website.


Requirements

Estimated time to completion: 15 minutes

  • Gestureworks Core license
  • Microsoft Windows 7 or 8
  • Eclipse 4.2 or later
  • PyDev plugin for Eclipse
  • Panda3D 1.7.2 or latest stable release
  • Python 2.7 (included in Panda3D installation)
  • Multitouch display device

Process Overview

Process Detail

1. Download and install software prerequisites

Each of the following software packages must be downloaded and installed prior to continuing with the tutorial.

2. Download and install Gestureworks Core package

The Gestureworks Core installer package – GestureWorksCoreSetup.exe – contains the main GestureworksCore*.dll files (the “native” DLLs), various bindings (C++ .NET, Python, etc.), and supporting documentation. Gestureworks Core must be licensed prior to use in any software project.

  • Download the Gestureworks Core Trial package from here.
  • Double-click the downloaded installer package GestureWorksCoreSetup.exe to install Gestureworks Core. Gestureworks Core consists of the Gestureworks Core DLLs as well as various tutorials, bindings, and documentation.

GestureWorksCore*.dlls
\GestureWorksCore\GestureworksCore32.dll
\GestureWorksCore\GestureworksCore64.dll

Python bindings
\GestureWorksCore\bindings\python\gwc_python

Python tutorials
\GestureWorksCore\bindings\python\panda3d\tutorials

Assets for the tutorials
\GestureWorksCore\bindings\python\panda3d\assets

3. Configure Eclipse for Python

You will need to install the PyDev Plugin. In Eclipse, select Help → Install New Software

Panda 1 1.PNG

In the Work With field, enter http://pydev.org/updates, check the PyDev package and follow the rest of the instructions. Now that PyDev is installed, we have to configure a Python interpreter to work with Panda3D.

4. Configure Eclipse for Panda3D

Open the Preferences menu by selecting Window → Preferences. Expand the PyDev submenu and select Interpreter - Python. Create a new interpreter and name it something like “Python2.7 - Panda3D”, where the path points to the Python interpreter that came with Panda3D.

Panda 1 2.PNG

Click Next and add the Panda3D folders to the Library:

Panda 1 3.PNG

Under the Forced Builtins tab, click New and add the following keyword - direct. Then after adding the previous keyword, click New and add this keyword - pandac.

5. Create A New Panda3D Project In Eclipse

  1. Click File → New → PyDev Project
  2. Name the Project “Panda3D_Tutorial_01”
  3. (optional) Set the project directory to your desired location
  4. Make sure that Grammar Version is set to 2.7
  5. Make sure that Interpreter is set to Python2.7 - Panda3D
  6. Click Finish

Panda 1 4.PNG

6. Add gwc_python module to project

The gwc_python module is the binding layer you will use to communicate with Gestureworks Core.

  1. Right click on the new project in the Package Explorer and then click Import. Select General → File System.
  2. Browse to the folder containing the downloaded Gestureworks Core files, navigate to the Python bindings folder and select gwc_python.
  3. Select all files, including the containing folder.
  4. Check the Create complete folder structure box.
  5. Click Finish

Panda 1 5.PNG

The gwc_python module is now added to the project in Eclipse:

Panda 1 6.PNG


Review

In this tutorial we installed Gestureworks Core, the prerequisites for developing with the Gestureworks Core Python bindings, and created a project that includes the Python binding module. From here we move on to Python & Panda3D: Getting Started II (Hello Multitouch) in which we dig into actual source code, initialize Gestureworks Core and work with touch event data.


Next tutorial: Python & Panda3D: Getting Started II (Hello Multitouch)

tutorials/legacy/python_panda3d/getting_started_1_hello_world.txt · Last modified: 2019/01/21 19:24 (external edit)