Obj: handle 3D mesh from the OBJ format file.

Obj: handle 3D mesh from the OBJ format file.

OBJ is a geometry definition file, adopted by many vendor graphics. To known more about the format, check http://en.wikipedia.org/wiki/Obj

class pymt.obj.OBJ(filename, file=None, path=None, compat=True)

3D object representation.

Parameters :
filename : string

Filename of object

file : File object, default to None

Use file instead of filename if possible

path : string, default to None

Use custom path for material

compat : bool, default to True

Set to False if you want to take care yourself of the lights, depth test, color...

draw()

Draw the object on screen

open_material_file(filename)

Override for loading from archive/network etc.

class pymt.obj.Material(name)

Bases: object

Material class to handle attribute like light (ambient, diffuse, specular, emmission, shininess), opacity, texture...

apply(face=GL_FRONT_AND_BACK)

Apply the material on current context

class pymt.obj.MaterialGroup(material)

Bases: object

Groups of material

class pymt.obj.Mesh(name)

Bases: object

Class to store a mesh in T2F_N3F_V3F format.

compile()

Compile the mesh in display list

draw()

Draw the mesh on screen (using display list if compiled)

Previous topic

Logger: the PyMT logger

Next topic

Parser: default parser from string to special type

This Page