@Arza_Sajid wrote:
Hey guys, I have created a 2d grid of squares 5x5
I am trying to rotate the squares individually, the code i have so far is
ofSeedRandom(0);ofSetRectMode(OF_RECTMODE_CENTER); for(int i = 0; i < 5; i++){ for(int j=0; j<5; j++){ float r =(i+j+ofGetElapsedTimef())*60; glPushMatrix(); glTranslatef(ofGetWindowWidth()/3,ofGetWindowHeight()/3,0); glRotatef(r/10,1,1,1); ofSetColor(colors[i].r, colors[i].g, colors[i].b); ofRect(i*80, j*80, 60,60); glPopMatrix();
this rotates the whole grid not the squares individually, any help would be apperciated.
thanks!
Posts: 2
Participants: 2