added Python binding for material.h classes
added raytracermodule.h header file for declarations
updated car.py demo
added texture.py demo (based on spheres_glass.py)
all remaining 'centre' changed to more common 'center'
added some more const's to material.h
# Wavefron .obj file loader
from pyrit import Triangle, NormalVertex
def LoadWavefrontObjFile(rt, filename, mat, scale):
vertices = []
fp = file(filename)
while True:
ln = fp.readline()
if ln == "":
break;
ln = ln.split()
if ln[0] == "v":
v = [scale*float(x) for x in ln[1:4]]
vertices.append(tuple(v))
if ln[0] == "f":
f = [vertices[int(x)-1] for x in ln[1:4]]
face = Triangle(NormalVertex(f[0]), NormalVertex(f[1]), NormalVertex(f[2]), mat)
rt.addShape(face)