{ "info": { "author": "Jakub Stasiak", "author_email": "jakub@stasiak.at", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Multimedia :: Graphics :: 3D Rendering", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "python-cg\n=========\n\n.. image:: https://travis-ci.org/jstasiak/python-cg.png?branch=master\n :alt: Build status\n :target: https://travis-ci.org/jstasiak/python-cg\n\nWhat is python-cg?\n------------------\n\n*python-cg* is a Python wrapper for\n`NVidia Cg Toolkit `_ runtime. I've started it because I like Python, I like NVidia CG and I want to to do some computer game/3d graphicsprototyping and research. Also I still find C++ counterproductive as far as my needs are concerned and I don't want to waste my time doing boring stuff. Programming in Python is fun.\n\nI know about some projects that were meant to bring CG to Python but as far as I know they're history now.\n\nProject is hostead at GitHub: https://github.com/jstasiak/python-cg.\n\nWhat's the state?\n-----------------\n\nThe project is in very early development stage. Overview of what's supported right now:\n\n* Cg contexts\n\n * creating\n * destroying\n\n* CgFX effects\n\n * creating from file\n * creating directly from source code\n\n* accessing effects` techniques and their passes\n* accessing effect parameters with their names, semantics and parameter-specific metadata (rows, columns etc.)\n* setting sampler parameters and most of numerical parameters\n\nWhat doesn't work at the moment and there's no plan to implement it:\n\n* everything that's left (well, until I decide I need some of it or someone else does that)\n\nRequirements\n------------\n\nThis project requires:\n\n* NVidia Cg Toolkit \u2265 3.0\n* Python interpreter (+ development files):\n \n * 2.x \u2265 2.6, or\n * 3.x \u2265 3.2\n\n* C and C++ compiler\n\nPython packages required to build and install *python-cg*:\n\n* Cython \u2265 0.18\n* numpy\n\nTo build documentation/run tests you also need:\n\n* Mock \u2265 1.0\n* Nose \u2265 1.2\n* Sphinx ~ 1.2 (development version)\n\n\nDocumentation\n-------------\n\nPregenerated documentation can be found at https://python-cg.readthedocs.org/en/latest/.\n\nYou can also build documentation all by yourself by calling::\n\n sphinx-build -b html docs docs/build/html\n\nGenerated HTML files are placed in ``docs/build/html/`` directory.\n\n\nBuilding\n--------\n\nTo build the project in place, run::\n\n python setup.py build_ext --inplace\n\nImportant information\n---------------------\n\n* This project works with OpenGL and OpenGL only\n* It uses row-major matrices by default, just like numpy does\n\nQuickstart\n----------\n\nFirst you need to create an instance of\n`CG `_ class and use it to create new\n`Context `_::\n\n from cg import CG\n\n cg = CG()\n context = cg.create_context()\n\nWe want to use an effect to render some stuff so we're gonna create\n`Effect `_ from file::\n\n effect = context.create_effect_from_file('effect.cgfx')\n\n.. note:: This assumes that you have a file named ``effect.cgfx`` and that it contains\n a valid CG effect.\n\nWe now have access to Effect's techniques and parameters::\n\n for technique in effect.techniques:\n # ...\n\n for parameter in effect.parameters:\n # ...\n\n\nFor the sake of simplicity let's say we have a parameterless effect with only one\n`Technique `_::\n\n technique = effect.techniques[0]\n\nNow we can access technique's passes. Each `Pass\n`_ has methods `begin()\n`_ and `end()\n`_ and the actual\ndrawing has to take place between a call to ``begin`` and ``end``::\n\n gl.glClear(gl.GL_COLOR_BUFFER_BIT)\n\n for pass_ in technique.passes:\n pass_.begin()\n\n\n gl.glBegin(gl.GL_TRIANGLES)\n gl.glVertex3f(-0.5, -0.5, 0)\n gl.glVertex3f(0.5, -0.5, 0)\n gl.glVertex3f(0, 0.5, 0)\n gl.glEnd()\n\n pass_.end()\n\n # swap buffers\n\nYou can find complete, runnable example application in ``example`` directory. Please note that\nit requires (in addition to *python-cg* requirements):\n\n* Development version of SFML 2\n* Python packages listed in ``example/requirements.txt``::\n\n pip install -r example/requirements.txt\n\nThen to run the example::\n\n python setup.py build_ext --inplace\n PYTHONPATH=. python example/main.py\n\n\nTesting\n-------\n\nTo run tests, execute::\n\n python runtests.py\n\n\nLicense\n-------\n\n\u00a9 2013, Jakub Stasiak\n\nThis project is licensed under MIT License, see `LICENSE `_ file for details.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jstasiak/python-cg", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "python-cg", "package_url": "https://pypi.org/project/python-cg/", "platform": "unix,linux,os x", "project_url": "https://pypi.org/project/python-cg/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jstasiak/python-cg" }, "release_url": "https://pypi.org/project/python-cg/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Python wrapper for NVidia Cg Toolkit", "version": "0.1.3" }, "last_serial": 797874, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "6a583a803c11e1a85693696694c28408", "sha256": "003cff52f853381a712ffe487048eb4e8e9d85404a0ee98c437635caaf37356e" }, "downloads": -1, "filename": "python-cg-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6a583a803c11e1a85693696694c28408", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66035, "upload_time": "2013-04-10T09:26:15", "url": "https://files.pythonhosted.org/packages/d2/c5/93ca34fab611c827958498ce892617d205fa08d84818455bc52464844e06/python-cg-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6a583a803c11e1a85693696694c28408", "sha256": "003cff52f853381a712ffe487048eb4e8e9d85404a0ee98c437635caaf37356e" }, "downloads": -1, "filename": "python-cg-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6a583a803c11e1a85693696694c28408", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66035, "upload_time": "2013-04-10T09:26:15", "url": "https://files.pythonhosted.org/packages/d2/c5/93ca34fab611c827958498ce892617d205fa08d84818455bc52464844e06/python-cg-0.1.3.tar.gz" } ] }