Slide 18
Slide 18 text
OK, it’s so easy!
Computer Graphics Course @Waseda University
// Rotate 1st cube and draw!
glRotatef(theta * 2, 0, 1, 0);
drawCube();
...
// Rotate 2nd cube and draw!
glRotatef(theta, 0, 1, 0);
drawCube();
← Matrix rotates 1st cube by (2 * theta)
← Matrix rotates 1st cube by (theta + 2 * theta)
→ Matrix multiplication is accumulated!
This is a stupid solution! Take care the lifetime of “glRotatef”.