I am trying to implement my own rotation function in OpenGL on C++, i.e. something like glRotate. My code for rotating around y looks like this:
When I'm doing a call like:Code :void do_rotateY(GLdouble angle) { //rotate around y axis GLdouble s = angle; GLdouble c[4][4]; c[1][1] = c[3][3]= 1.0; c[0][0] = c[2][2] = cos(s); c[2][0] = sin(s); c[0][2] = -c[2][0]; glMultMatrixd(*c); }
nothing appears on the screen. When I replace do_rotateY(...) with glRotatef(...) I can see everything correctly.Code :glPushMatrix(); do_rotateY(100); ...draw something... glPopMatrix();
Thanks for your help!



