How do I apply materials to groups of objects in C