while loop

im tring to use a while loop functionto try colouring different coloured triangles along a triangle polymesh how can i colour each one seperately, and not stop one colour being repeated?

here is the code im using for while loop

while((faceIndex!=-1) && m->C[faceIndex].r!=(1.0))
{
//makes a length of red terrain
m -> C [faceIndex].r =(1.0);
m -> C [faceIndex].g =(0.0);
m -> C [faceIndex].b =(0.0);
m -> C [faceIndex].a =(1.0);

here is the code im using in a previous function to call a triangle face

            int myFace1, myFace2;

myFace1 = m -> E [myEdge]. f1;
myFace2 = m -> E [myEdge]. f2;

thanks jofoxy

Got burnt with the for loop in the advanced forum, eh :wink:

Anyway, it would help if you showed the code that actually rendered the triangles.

FYI

m->C[faceIndex].r!=(1.0)

Be carful when using floats or doubles when using an equate operator it’s dangerous due to the normal limitation and rounding with floats and doubles

Try to use >= or <= rather than == or !=

How are you drawing your polygons and how are you currently assigning colors to them when you draw them