Git Product home page Git Product logo

yodck / nodebox-opengl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nodebox/nodebox-opengl

0.0 0.0 0.0 4.76 MB

Free, cross-platform library for generating 2D animations with Python programming code.

Home Page: http://www.cityinabottle.org/nodebox/

License: BSD 3-Clause "New" or "Revised" License

C++ 0.41% Python 23.80% C 34.57% Prolog 1.69% OpenEdge ABL 36.95% TeX 2.38% Makefile 0.20%

nodebox-opengl's Introduction

NodeBox for OpenGL
==================

NodeBox for OpenGL (NOGL) is a Python module for creating 2D interactive visuals using OpenGL. It is based on the command set of the classic NodeBox for Mac OS X (http://nodebox.net). It has support for Bezier paths, text, image filters (blur, bloom, ...), offscreen rendering, animation & motion tweening, and simple 2D physics. Its purpose is to implement a small game engine for "City In A Bottle" (http://cityinabottle.org).

VERSION
=======

1.7

LICENSE
=======

BSD, see LICENSE.txt for further details.

REQUIREMENTS
============

NodeBox for OpenGL is built on the excellent Pyglet module. It works on all platforms if you have Python and Pyglet installed. Note: on Mac OS 10.5, Python is already installed. On Mac OS X 10.6+ (Snow Leopard), you need to install a 32-bit version of Python (Pyglet won't work as expected with the preinstalled 64-bit version).

- Python 2.5-6 : an installer can be downloaded from http://www.python.org/download/
- Pyglet 1.4+  : an installer can be downloaded from http://www.pyglet.org/

Your video hardware needs support for OpenGL 2.0.
If this is not the case, try updating to a new driver.

INSTALLATION
============

If you have pip, you can automatically download and install from the PyPi repository:
> pip install nodebox-opengl

If that doesn't work, download the latest version manually. To be able to import NodeBox in your scripts, Python needs to know where the module is located. There are three basic ways to accomplish this:

- Put the nodebox/ folder in the same folder as your script.
- Put the nodebox/ folder in the standard location for modules so it is available to all scripts.
  The standard location depends on your operating system, for example:
  /Library/Python/2.5/site-packages/ on Mac,
  /usr/lib/python2.5/site-packages/ on Unix,
  c:\python25\Lib\site-packages\ on Windows.
- In your script, add the location of NodeBox to sys.path, before importing it:
  >>> MODULE = '/users/tom/python/nodebox'
  >>> import sys; if MODULE not in sys.path: sys.path.append(MODULE)
  >>> import nodebox

If you get an "import pyglet" error, make sure that Pyglet is installed in site-packages/ too.

Binaries:
NOGL contains C extensions for faster mathematics. If you want to activate them, you need to compile them from source. 
From the command line, do:
> cd nodebox/ext
> python setup.py

USAGE
=====

- For users coming from NodeBox for Mac OS X: this NodeBox for OpenGL does not have a built-in code editor. You can use the IDLE editor bundled with Python. On Mac OS X, we prefer TextMate (http://macromates.com).
- From the command line, you can run a script with: python example.py (or command-R in TextMate)
- This will open an application window with the output of your script.

Here is a simple NodeBox script:

>>> from nodebox.graphics import *
>>> def draw(canvas):
>>>     canvas.clear()
>>>     translate(250, 250)
>>>     rotate(canvas.frame)
>>>     rect(x=-50, y=-50, width=100, height=100)
>>> canvas.size = 500, 500
>>> canvas.run(draw)

It imports the nodebox.graphics module with the standard set of drawing commands. It defines a draw() function and attaches it to the canvas, so that it will be drawn each animation frame. It opens the main application window with canvas.run().

DOCUMENTATION
=============

http://cityinabottle.org/nodebox

ACKNOWLEDGEMENTS
================

Author: 
- Tom De Smedt ([email protected])

Contributing authors:
- Frederik De Bleser
- Lieven Menschaert
- Giorgio Olivero

Contributors:
- Karsten Wolf
- Tuk Bredsdorff

City In A Bottle:
- Nicolas Marinus
- Ludivine Lechat
- Tim Vets
- Frederik De Bleser
- Tom De Smedt

Copyright (c) 2008-2012 City In A Bottle

nodebox-opengl's People

Contributors

jsundram avatar qulogic avatar fdb avatar galland avatar ont avatar steve2072 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.