%COMP 236 Programming Assignment 2
%Adrian Ilie, Mar. 2002

function t=readTriFile(fileName)
fid=fopen(fileName,'r');

m=fscanf(fid,'%f %f %s %f %f %s %f %f %s');
sm=size(m);
sm=sm(1);
sm=round(sm/36);
m=reshape(m,[36 sm])';
x1=m(:,1);
y1=m(:,2);
x2=m(:,13);
y2=m(:,14);
x3=m(:,25);
y3=m(:,26);
r1=hex2dec(char(m(:,7:8)));
g1=hex2dec(char(m(:,9:10)));
b1=hex2dec(char(m(:,11:12)));
r2=hex2dec(char(m(:,19:20)));
g2=hex2dec(char(m(:,21:22)));
b2=hex2dec(char(m(:,23:24)));
r3=hex2dec(char(m(:,31:32)));
g3=hex2dec(char(m(:,33:34)));
b3=hex2dec(char(m(:,35:36)));

o=ones(sm,1);

t=[x1 x2 x3 y1 y2 y3 .25*o .25*o .25*o r1 r2 r3 g1 g2 g3 b1 b2 b3];


