Hello everyone,
Here's my problem. I'm drawing a box using a GL_TRIANGLE_STRIP. There is no texture involved, no material and no shaders. I'm just rendering colored triangle.
You can see what it looks like here : Fail box
But as you can see, I've some clear color fading problem. There is no lighting activated either.
Here the code I use to init and render the box.
//here init code
for(list<Particle*>::iterator p = this->shapes[this->activeShape].particles.begin();
p != this->shapes[this->activeShape].particles.end(); p++)
{
float yValue = 20.0f;
this->vertexArray[this->activeShape][current].Position.x = (*p)->x0.x;
this->vertexArray[this->activeShape][current].Position.y = -yValue;
this->vertexArray[this->activeShape][current].Position.z = (*p)->x0.y;
this->vertexArray[this->activeShape][current + listSize].Position.x = (*p)->x0.x;
this->vertexArray[this->activeShape][current + listSize].Position.y = yValue;
this->vertexArray[this->activeShape][current + listSize].Position.z = (*p)->x0.y;
current++;
}
// render code
glFrontFace(GL_CW);
glEnable(GL_BLEND);
glVertexPointer(3, GL_FLOAT, sizeof(LsmVertexColor), &this->vertexArray[this->activeShape][0].Position);
glEnableClientState(GL_VERTEX_ARRAY);
glColor4f(SCULPTY_R, SCULPTY_G, SCULPTY_B, SCULPTY_A);
glDrawElements(GL_TRIANGLE_STRIP, 20, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][0]);
glDrawElements(GL_TRIANGLE_STRIP, 20, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][22]);
glDrawElements(GL_TRIANGLE_STRIP, 10, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][44]);
glDrawElements(GL_TRIANGLE_STRIP, 10, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][54]);
I'm using OpenGL ES 1.1 (I know I'm not up-to-date) and the program is running on iPhone/iPad.