Any can please give opengl c++ code for Rubik's cube...

i created rubik's cube...

but i cant rotate each slice...

void colorcube()
{

for(i=0;i<=.66;i=i+.22)