Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

Gloopy is a Python library for creating 3D polyhedra and rendering them using OpenGL. It uses Pyglet to open a window and manage events, and PyOpenGL for OpenGL bindings.

Gloopy provides the following services:

  • Creation and manipulation of 3D, flat-surfaced, polyhedra, using the Shape class.
  • Factory functions to produce particular shapes, such as Cube or Icosahedron.
  • Some basic algorithms to modify existing shapes, such as by subdividing or extruding their surfaces.
  • Conversion of shapes into Glyph instances, which manage vertex arrays stored in a VBO.
  • A simple Render class which renders glyphs with given positions and orientations.
  • A camera attribute on the single Gloopy instance, that can be positioned, oriented, or told to look at a particular item or position.

Dependencies

Written mostly on Windows, tested occasionally on Ubuntu.

  • Python 2.7
  • distribute 0.6.14
  • pyglet 1.1.4
  • PyOpenGL 3.0.1

Documentation

In the Gloopy source, see 'docs/html/index.html'

This is installed into your Python installation's 'share/doc' directory.

See also the scripts in the 'gloopy/examples' directory.

Documentation is not currently available online.

License

Gloopy is released under the terms specified in LICENSE.txt.

Status & Known Issues

It works for me, but has not been used on any real projects. The API is a mess and may change substantially in later releases.

No issue tracker is currently maintained, but the major shortfalls as I percieve them are:

  • Some algorithmic modifiers, such as face subdivision, extrusion, stellation, do not currently work on MultiShapes. This is because these modifiers rely on modifying attributes of the given shape in place, such as by inserting new entries in the .faces collection. However, MultiShapes provide many of these attributes by using generators to form a composite stream of their children. I guess I ought to make all shape modifiers functional.
  • The supplied 'directional lighting' shader is broken - rotating an object does not modify the apparent illumination of its surfaces.
  • No attempt is made to handle textures. All faces are plain colors.
  • We don't currently handle multiple shaders within a single scene.

Thanks

PyWeek participants 'Scav' and 'Threads' for showing me how it should be done, and PyWeek message board users donal.h, Cosmologicon, RB[0], PyTM30, Tee and saluk for cajoling me into accepting the merit of allowing people to bring pre-existing codebases into PyWeek so long as they are public.

Recent activity

Jonathan Hartley

Commits by Jonathan Hartley were pushed to tartley/gloopy

a974ca3 - Change the parts of the code that needed fixes when we transformed colors from ubyte to float: They should now be more robust to similar ...
Jonathan Hartley

Commits by Jonathan Hartley were pushed to tartley/gloopy

2ef4e3f - no longer need make_virtualenv script - virtualenvs should live outside the project folder, in a machine-wide place, then there can be one per development machine, ...
Jonathan Hartley

Commits by Jonathan Hartley were pushed to tartley/gloopy

aca48f6 - Gloopy now passes iterable of Glyphs to render.draw_world function (animated space invaders don't show up, but they crashed before this commit anyway). Fix BitmapCubeCluster to ...
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.