I want to make a cube rollover in opengl space, something like(http://www.youtube.com/watch?v=4IEFC_Y3nrA&feature=related). I made something like this for Y axes:
glTranslate(0, _y, 0);
glRotatef(_rot, -1, 0, 0, 0);//rotate
glTranslate(0, -CUBE_HALF_SIZE, CUBE_HALF_SIZE);//around point
if(_rot > 180)
_rot = 90;
_y = _y + CUBE_SIZE;
This is working, but is not ok, because the texture will not be shown correctly after _rot = 90, because the object is rotated to 90 again. So does anyone knows how to do it?
Thanks, in advance!