Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 1.76 KB

README_md.md

File metadata and controls

71 lines (51 loc) · 1.76 KB

Pyglet Helper

All pyglet_helper objects rotating at once

Build Status

Coverage Status

The goal of this project is to make pyglet usable to people with no OpenGL experience by reproducing the functionality of VPython for drawing geometric primitives.

Installation

To Install this project, either pull it from the PyPI:

pip install -i https://testpypi.python.org/pypi PygletHelper

or clone it and build from source:

git clone https://github.com/CatherineH/pyglet_helper
cd pyglet_helper
python setup.py install

Usage

The following example will show how to create a window with a sphere:

A red sphere in a window

First, create a pyglet window to draw the shapes to:

from pyglet.window import Window
window = Window()

Then, create a pyglet_helper view:

from pyglet_helper.objects.renderable import View
scene = View()

Create a gl light:

_light = Light()
_light.render(scene)

Geometric objects can be added to scene. For example, to define a red sphere in the center of the view:

from pyglet_helper.util import color
_ball = Sphere(pos=(1, 1, 0), radius=0.5, color=color.red)

Finally, render the object, and run the pyglet window:

_ball.render(scene)
pyglet.app.run()

Documentation

The documentation is available on my github page.