0
for (int i = 0; i < 5; i++)
{
    glTranslatef(0.0f, 0.0f, 5.0f);
    glRotatef(rotation, 5.0f, 0.0f, 0.0f);
    glBegin(GL_POLYGON); //Starts to draw a polygon 
    glEnable(GL_CULL_FACE);
    glCullFace(GL_BACK);
    cube->Draw();
    glEnd(); //Ends the polygon draw 
    glPopMatrix();
}

Is there a way that i can get the GLTranslatef to randomise the location of the cube each time a new one is drawn?

genpfault
  • 51,148
  • 11
  • 85
  • 139
dassad
  • 9
  • 2
  • 2
    [Many flavours in C++'s library.](http://en.cppreference.com/w/cpp/header/random) `std::uniform_real_distribution` is probably a good place to start. – user4581301 Apr 19 '18 at 18:28
  • 2
    http://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution – drescherjm Apr 19 '18 at 18:28

0 Answers0