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

function m=randomTriangles(imSize,numTri,color)
maxX=imSize(2);
maxY=imSize(1);

randX=unifrnd(1,maxX,numTri,3);
randY=unifrnd(1,maxY,numTri,3);

randR=unifrnd(0,255,numTri,3);
randG=unifrnd(0,255,numTri,3);
randB=unifrnd(0,255,numTri,3);

randZ=unifrnd(0,1,numTri,3);

if(color==1)
    m=[randX randY randZ randR randG randB];
else
    nr1=ones(numTri,1);
    nr0=zeros(numTri,1);
    m=[randX randY randZ nr1 nr0 nr0 nr0 nr1 nr0 nr0 nr0 nr1];
end
