for loops

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?

thanx

jofoxy

If you copied and pasted that correctly, your for statement is incorrect.

Syntax is:

for(initialisations;condition;loopincrementation)
statement;

Bugger me. I accidentally ventured into C for noobs. I hate it when that happened. Can anyone point me to the Advanced Opengl Forum?

Times are changing rgpc ! But don’t be so full of hate, and try to be more polite… That way, you just disgust newbies from going on.

You want the advanced opengl forum ? Just have a look at that :stuck_out_tongue:

The most advanced opengl forum

Cant read a merde.

Originally posted by jide:
[b]Times are changing rgpc ! But don’t be so full of hate, and try to be more polite… That way, you just disgust newbies from going on.

You want the advanced opengl forum ? Just have a look at that :stuck_out_tongue:

The most advanced opengl forum [/b]
I’m sorry jide (well I’m not really) but I don’t care. I very rarely venture onto this forum now because of the OT posts. And if I discourage just one noob from posting a beginners question in the Advanced forum, good. A Welshman should know enough English to know the meaning of the word Advanced.

I agree with rgpc. I mean common. This is an OPENGL forum for one thing and an ADVANCED one at that. For loop questions have no place here and it should be obvious to anyone w/ an IQ above 10 to know this. Sorry if I’m comming off quite aggressive but damn, ya know? Just b/c this code is part of a GL program doesn’t mean it belongs here.

I feel better now.

-SirKnight

I believe the question has already been answered by T101. Why the need to belabor the point?

the problem could be solved simply like i advocated a couple of years ago, create a miscellanous/lounge/rant forum (ie anything goes), if the post isnt ‘advanced gl or whatevr’ then the moderators can simply move it there,
the excuse ‘the poster should know not to post here’ doesnt wash

Originally posted by rgpc:
[b] [quote]Originally posted by jide:
[b]Times are changing rgpc ! But don’t be so full of hate, and try to be more polite… That way, you just disgust newbies from going on.

You want the advanced opengl forum ? Just have a look at that :stuck_out_tongue:

The most advanced opengl forum [/b]
I’m sorry jide (well I’m not really) but I don’t care. I very rarely venture onto this forum now because of the OT posts. And if I discourage just one noob from posting a beginners question in the Advanced forum, good. A Welshman should know enough English to know the meaning of the word Advanced.[/b][/QUOTE]I’m not sorry and I don’t care just like you. I just find that it’s somewhat ridiculous to make a whole book from a newbie post that should have been placed in the other forum.