Dice3DS project is a set of Python modules for dealing with 3D Studio format files. I have released it under the terms of a BSD-style license.
3D Studio is a 3D graphics modeling and rendering program that saved it images in a rather simple binary file format known as 3DS format. Although 3D Studio has not released the details of the 3DS format, it has been reverse engineered by some ambitious people, and I used the information to write Dice3DS, a Python package that slices and dices 3DS files.
Dice3DS requires Python 2.2 or higher, as it uses metaclass programming, and Python Numeric. Note that it is not a wrapper for lib3ds; it's a Pure Python module.
There are two packages in Dice3DS: Dice3DS, and Dice3DS.example. The latter includes some modules that exemplify the use of Dice3DS, although they are not very versatile.
Here's a brief description of each module:
Slice and dice 3DS files.
Provides for reading, writing, and manipulating 3DS files. It's
called dom3ds because it's reminiscent of XML-DOM: it converts the 3DS
file into a hierarchy of objects, in much the same way XML-DOM
converts an XML file into a hierarchy of objects called the Document
Object Model. The dom3ds module creates an object for each chunk in
the 3DS file, which can be accessed hierarchially as attributes.
For example, once a 3DS file is loaded, you could the smoothing data
of the second object like this:
Utitily function for Dice3DS.
Defines some routines for calculating normals and transforming points.
Basic abstract classes representing a 3DS model.
Defines some classes that represent objects and materials of a 3DS
file in a more convienient form. It has methods to convert from the
DOM format. The classes can serve as base classes for more advanced
Classes for rendering 3DS models in OpenGL.
Defines some classes (based on Dice3DS.example.basicmodel) with some
additional methods to draw the model in OpenGL, or create a display
list to do so. Requires PyOpenGL.
OpenGL texture object abstraction.
Provides a class that is an abstraction of OpenGL texture objects. It
can create textures from image files, and automatically generates
mipmaps if requested. Requires PyOpenGL and Python Imaging Library.
Example of loading 3DS models.
Provides functions to load a 3DS model and creating a GLModel (or
BasicModel) from it. Shows how to load models from the filesystem, or
directly from a zip file.
What's New in This Release: [ read full changelog ]
· Updates were made to the view3ds and example modules.
· Now you can use pyglet.gl as well as PyOpenGL.
· You can use the image loading functions of the GUI being used (pyglet or pygame), so PIL does not need to be installed, but PIL will be used if it's available.
· A new default front-end based on GLUT was added.
· New view3ds options were added to set window size and disable textures.