joeybird
March 5th, 2005, 07:36 AM
hi i wish to create a for loop, with this code information, does anyone know how to do this, i want to colour in certain triangles along a triangle polymesh, i want them to be different colours but they must not repeat a colour.
here is the code from CGPolymesh.cpp
for ((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);
faceIndex = nextFace(m, faceIndex, edgeIndex);
//makes a length of red and white triagle strips terrain
m -> C [faceIndex].r =(6.0);
m -> C [faceIndex].g =(6.0);
m -> C [faceIndex].b =(6.0);
m -> C [faceIndex].a =(6.0);
faceIndex = nextFace(m, faceIndex, edgeIndex);
}
in main.cpp the beginning triangle specifed is
faceStrip(&myTerrain, 8, 2);
what am i doing wrong ? am i doing the
for(initialisations;condition;loopincrementation)
statement;
correct?
thanx
joeybird
here is the code from CGPolymesh.cpp
for ((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);
faceIndex = nextFace(m, faceIndex, edgeIndex);
//makes a length of red and white triagle strips terrain
m -> C [faceIndex].r =(6.0);
m -> C [faceIndex].g =(6.0);
m -> C [faceIndex].b =(6.0);
m -> C [faceIndex].a =(6.0);
faceIndex = nextFace(m, faceIndex, edgeIndex);
}
in main.cpp the beginning triangle specifed is
faceStrip(&myTerrain, 8, 2);
what am i doing wrong ? am i doing the
for(initialisations;condition;loopincrementation)
statement;
correct?
thanx
joeybird