Code Monkey home page Code Monkey logo

pywavefront's Introduction

PyWavefront

This python module allows you to read Wavefront 3D object files (something.obj and something.mtl) and use them as Python objects. Currently Pyglet is required to render and display these objects.

Currently, only a subset of the defined specification has been implemented.

Requirements

Usage

From Python

import pywavefront
meshes = pywavefront.Wavefront('something.obj')
meshes.draw()

Example Script

There are two pyglet example scripts with included .obj and .mtl files in the example directory. To run them, change to the example directory and run either ./pyglet_demo.py or .pyglet_demo2.py.

Generating a Wavefront file with Blender

The following presumes you are using Blender to generate your mesh:

  • Using Blender, create a mesh with a UV-mapped texture. The UV-mapping is important! If it is working properly, you will see the texture applied within Blender's 3d view.
  • Export the mesh from Blender using the Wavefront format, including normals.
  • Reference your *.obj file as in the pywavefront example above.

Installation

Source distribution

Assuming you are in the top-level PyWavefront directory:

python setup.py install

Pip

pip install PyWavefront

Tests

All tests can be found in the test directory. To run the tests:

  • Install nose: pip install nose
  • Change to the top-level directory, e.g. PyWavefront, the directory that contains this README file.
  • Run nosetests

Contributors

  • dav92lee
  • Jerek Shoemaker
  • Kurt Yoder
  • Zohar Jackson

License

PyWavefront is BSD-licensed; see file LICENSE.

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.