Reactive Panda: High level programming for Panda 3D

The Western State Colorado University Computer Science Department is happy to announce the initial release of Reactive Panda, a Python library for Functional Reactive Programming in the Panda3D game engine.We have used this for the past 10 years in our computer camp where kids in grades 8 – 12 construct interesting games, animations, and everything in-between. It serves as an introductory tool to high-level languages, watering down some of the more difficult aspects through implicit time flow and a simple syntactical structure.Reactive Panda simplifies Panda3D programming by making time flow implicit. It was inspired by work on Fran by Conal Elliott and Father Time by Greg Cooper.

This library creates “reactive proxy” objects for the underlying Panda3D objects and continuously updates every object. The behavior and event model of FRP is supported and many of the standard FRP vocabulary is provided. In addition, FRP has been augmented by an object oriented model that integrates well into the underlying game engine.

Features of this library include:

A small library objects to construct 3D worlds: 3D models of uniform size and orientation, textures, and sounds.

A set of reactive data types for points, colors, orientations, and interpolation and commonly used functions over these types.

A set of reactive objects corresponding to panda3D models, lights, particle effects, the camera, and other game engine objects.

Event / Behavior views of interaction and a library of basic FRP operations. Many of the 2D GUI elements such as text, sliders, and menus have reactive counterparts.

An easy to understand default coordinate system and camera position.
Simple collision detection and support for reactive

An import feature to make existing 3D models reactive
Examples and sample code

The reactive style of programming makes it easy to “get things moving”. For example, our reactive “hello world” is

panda(hpr=hpr(time,0,0))

This displays a spinning panda (all angles are in radians so the panda takes about 6 seconds to spin). Note that hpr(heading, pitch, roll) is both the name of the parameter to the panda constructor and the object constructor for orientations. The panda constructor implicitly adds the panda to the scene. This is the first public release of our library so you can expect to find bugs and incomplete documentation, but we are working to improve the release in all aspects.

Some of the known deficiencies of our system:

We haven’t added custom collision geometry to our models – instead we use a very inaccurate collision model based on sphere and cylinders that often detects collisions when objects are not really touching.

Support for debugging is minimal

Not all panda3D features have been made available to the reactive world

Python makes some of the functional programming aspects of our library a bit awkward

This library doesn’t play nice with other programming styles – you should either use reactive programming for everything or not at all.

We would like to make the material for our summer camp available but haven’t had time to get it all together.

The very first release of Reactive Panda can be found at http://reactive-engine.org; please do note hesitate to give feedback, criticism, or new ideas. :slight_smile:

reactive-engine.org

In Russia this site blocked :open_mouth:

This looks interesting, thanks for sharing! This seems like a very interesting way of programming with Panda. I can see this being especially useful for prototyping.

I’ll have to find some time to play around with this.