glTranslatef lost values

Some Code For you


void SceneManager::DrawRenderList(void)
{
		std::list<Mesh *>::iterator i = MeshList.begin();    
	
		glEnableClientState(GL_NORMAL_ARRAY);
		glEnableClientState(GL_COLOR_ARRAY);
		glEnableClientState(GL_VERTEX_ARRAY);

	
while (i != MeshList.end())
	{
		glTranslatef(0.0f,2.0f, -5.0f);
		glPushMatrix();
		(*i)->PositionForDraw();
		(*i)->Draw();
	        glPopMatrix();
		i++;
	}
		glDisableClientState(GL_VERTEX_ARRAY);  // disable vertex arrays
		glDisableClientState(GL_COLOR_ARRAY);
		glDisableClientState(GL_NORMAL_ARRAY);
	
}


void Mesh::PositionForDraw()
{
	 glTranslatef(modelPosition[0],modelPosition[1], modelPosition[2]);
	 glRotatef(rotqube,0.0f,1.0f,0.0f);
     glRotatef(rotqube,1.0f,1.0f,1.0f);
}

void Mesh::Draw()
{
	glNormalPointer(GL_FLOAT, 0, &normals[0]);
    glColorPointer(3, GL_FLOAT, 0, &colors[0]);
    glVertexPointer(3, GL_FLOAT, 0, &vertices[0]);
    glTranslatef(3.0f,0.0f, 0.0f);
	glDrawArrays(GL_QUADS, 0, 24);
	glTranslatef(3.0f,0.0f,0.0f);
    glDrawArrays(GL_QUADS, 0, 24);
	glTranslatef(3.0f,0.0f,0.0f);
    glDrawArrays(GL_QUADS, 0, 24);

	 rotqube +=0.9f;	
}


in the Mesh.h

private:
    GLfloat modelPosition[3];
    GLfloat modelAngle[3];

Dosent Work
with


void Mesh::PositionForDraw()
{
GLfloat x=0.0f, y=0.0f, z=-10.0f;
	 glTranslatef(x,y,z);
	 glRotatef(rotqube,0.0f,1.0f,0.0f);
     glRotatef(rotqube,1.0f,1.0f,1.0f);
}

works fine


GLfloat x=modelPosition[0], y=fmodelPosition[1],
z=modelPosition[2];

//a cout x,y,z gives here right values
	 glTranslatef(x,y,z);
	 glRotatef(rotqube,0.0f,1.0f,0.0f);
     glRotatef(rotqube,1.0f,1.0f,1.0f);
}

dosent work.

Well looks like the values get f*****up
Can some one help me?

Does modelPosition[0],modelPosition[1] and modelPosition[2] have values?

Yes, when i cout them just bevor there are the right Values.
They are set in the Construktor.

You mean this does not work

but other one works?

if it works or not stands after the code.

So that one works

Problem Found, its not show up in this part of code.
I cast down to Mesh an there went some think wrong wiht the class variabels