3ds loading

I’ve made a basic 3ds loader(loads vertices and polygons) now i’m trying to load materials(colors first)-but I do not know how are they connected to the polygons.

www.wotsit.org