   nehe tutorial - triangle strips
  I have read this nehe tutorial about triangle strips: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=19I would like to make something like fountain: http://img546.imageshack.us/i/84842488.jpg/But now I have only something that: http://img199.imageshack.us/i/16154892.jpg/I don't understand why my current fountain is in white colour (it should have many colours) and why it is round - could you help ?#defineMAX_PARTICLES1000floatslowdown=2.0f;// Slow Down Particlesfloatxspeed;// Base X Speed (To Allow Keyboard Direction Of Tail)floatyspeed;// Base Y Speed (To Allow Keyboard Direction Of Tail)floatzoom=-40.0f;// Used To Zoom OutGLuintcol;// Current Color SelectionGLuintdelay;// Rainbow Effect Delaytypedef struct// Create A Structure For Particle{boolactive;// Active (Yes/No)floatlife;// Particle Lifefloatfade;// Fade Speedfloatr;// Red Valuefloatg;// Green Valuefloatb;// Blue Valuefloatx;// X Positionfloaty;// Y Positionfloatz;// Z Positionfloatxi;// X Directionfloatyi;// Y Directionfloatzi;// Z Directionfloatxg;// X Gravityfloatyg;// Y Gravityfloatzg;// Z Gravity}particles;// Particles Structureparticles particle[MAX_PARTICLES];// Particle Array (Room For Particle Info)static GLfloat colors[12][3]=// Rainbow Of Colors{{1.0f,0.5f,0.5f},{1.0f,0.75f,0.5f},{1.0f,1.0f,0.5f},{0.75f,1.0f,0.5f},{0.5f,1.0f,0.5f},{0.5f,1.0f,0.75f},{0.5f,1.0f,1.0f},{0.5f,0.75f,1.0f},{0.5f,0.5f,1.0f},{0.75f,0.5f,1.0f},{1.0f,0.5f,1.0f},{1.0f,0.5f,0.75f}};//draw scene:void Render(){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glShadeModel(GL_SMOOTH);// Enable Smooth ShadingglClearColor(0.0f,0.0f,0.0f,0.0f);// Black BackgroundglClearDepth(1.0f);// Depth Buffer SetupglDisable(GL_DEPTH_TEST);// Disable Depth TestingglEnable(GL_BLEND);// Enable BlendingglBlendFunc(GL_SRC_ALPHA,GL_ONE);// Type Of Blending To PerformglHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST);// Really Nice Perspective CalculationsglHint(GL_POINT_SMOOTH_HINT,GL_NICEST);// Really Nice Point SmoothingGLuint tex = LoadTexture("../images/Particle.bmp"); //loading texture using SDLglEnable(GL_TEXTURE_2D);// Enable Texture MappingglBindTexture(GL_TEXTURE_2D,tex);for (int loop=0;loop<MAX_PARTICLES;loop++)// Initials All The Textures{particle[loop].active=true;// Make All The Particles Activeparticle[loop].life=1.0f;// Give All The Particles Full Lifeparticle[loop].fade=float(rand()%100)/1000.0f+0.003f;// Random Fade Speedparticle[loop].r=colors[loop*(12/MAX_PARTICLES)][0];// Select Red Rainbow Colorparticle[loop].g=colors[loop*(12/MAX_PARTICLES)][1];// Select Red Rainbow Colorparticle[loop].b=colors[loop*(12/MAX_PARTICLES)][2];// Select Red Rainbow Colorparticle[loop].xi=float((rand()%50)-26.0f)*10.0f;// Random Speed On X Axisparticle[loop].yi=float((rand()%50)-25.0f)*10.0f;// Random Speed On Y Axisparticle[loop].zi=float((rand()%50)-25.0f)*10.0f;// Random Speed On Z Axisparticle[loop].xg=0.0f;// Set Horizontal Pull To Zeroparticle[loop].yg=-0.8f;// Set Vertical Pull Downwardparticle[loop].zg=0.0f;// Set Pull On Z Axis To Zero}for (int loop=0;loop<MAX_PARTICLES;loop++)// Loop Through All The Particles{if (particle[loop].active)// If The Particle Is Active{float x=particle[loop].x;// Grab Our Particle X Positionfloat y=particle[loop].y;// Grab Our Particle Y Positionfloat z=particle[loop].z+zoom;// Particle Z Pos + Zoom// Draw The Particle Using Our RGB Values, Fade The Particle Based On It's LifeglColor4f(particle[loop].r,particle[loop].g,particle[loop].b,particle[loop].life);glBegin(GL_TRIANGLE_STRIP);// Build Quad From A Triangle StripglTexCoord2d(1,1); glVertex3f(x+0.5f,y+0.5f,z); // Top RightglTexCoord2d(0,1); glVertex3f(x-0.5f,y+0.5f,z); // Top LeftglTexCoord2d(1,0); glVertex3f(x+0.5f,y-0.5f,z); // Bottom RightglTexCoord2d(0,0); glVertex3f(x-0.5f,y-0.5f,z); // Bottom LeftglEnd();// Done Building Triangle Stripparticle[loop].x+=particle[loop].xi/(slowdown*1000);// Move On The X Axis By X Speedparticle[loop].y+=particle[loop].yi/(slowdown*1000);// Move On The Y Axis By Y Speedparticle[loop].z+=particle[loop].zi/(slowdown*1000);// Move On The Z Axis By Z Speedparticle[loop].xi+=particle[loop].xg;// Take Pull On X Axis Into Accountparticle[loop].yi+=particle[loop].yg;// Take Pull On Y Axis Into Accountparticle[loop].zi+=particle[loop].zg;// Take Pull On Z Axis Into Accountparticle[loop].life-=particle[loop].fade;// Reduce Particles Life By 'Fade'if (particle[loop].life<0.0f)// If Particle Is Burned Out{particle[loop].life=1.0f;// Give It New Lifeparticle[loop].fade=float(rand()%100)/1000.0f+0.003f;// Random Fade Valueparticle[loop].x=0.0f;// Center On X Axisparticle[loop].y=0.0f;// Center On Y Axisparticle[loop].z=0.0f;// Center On Z Axisparticle[loop].xi=xspeed+float((rand()%60)-32.0f);// X Axis Speed And Directionparticle[loop].yi=yspeed+float((rand()%60)-30.0f);// Y Axis Speed And Directionparticle[loop].zi=float((rand()%60)-30.0f);// Z Axis Speed And Directionparticle[loop].r=colors[col][0];// Select Red From Color Tableparticle[loop].g=colors[col][1];// Select Green From Color Tableparticle[loop].b=colors[col][2];// Select Blue From Color Table}}}glFlush(); SwapBuffers(hDC); }
  Can't see anything obvious wrong with it, does your colours get set properly? If you did:float r = particle[color="#666600"][loop[color="#666600"]].r;float g = particle[color="#666600"][loop[color="#666600"]].g;float b = particle[color="#666600"][loop[color="#666600"]].b;float a = particle[color="#666600"][loop[color="#666600"]].life;glColor4f[color="#666600"](r[color="#666600"], g[color="#666600"], b[color="#666600"], a[color="#666600"]); Do you get expected values? try it without using the texture, do you get expected colors?Also, you might get more help with a more appropriate title (I don't think this is related to triangle strips - though it could be). You could try using GL_TRIANGLES instead of a strip and see if that helps.glBegin(GL_TRIANGLES);glVertex3f top rightglVertex3f top leftglVertex3f bottom rightglVertex3f top leftglVertex3f bottom leftglVertex3f bottom rightglEnd();   ;  I had enabled white light and this was the reason white colour but how I can change height fountain, now it is circular...   