| 482 | | 1. Introduce zoom in/out functionality of the viewer by adding mouse wheel events to the end of `mouse()` |
| | 482 | 1. OK, it rotates. But how come the light rotates with the teapot? I'm pretty sure that the light is not rotated while the teapot vertices are. Answer: Take a look into the `normal`. You need to rotate the vertex normal in the `vertex_shader[]` too! With a code like: |
| | 483 | {{{ |
| | 484 | #!c |
| | 485 | vec4 n = RotationMatrix*vec4(gl_NormalMatrix*gl_Normal, 1);\ |
| | 486 | normal=normalize(n.xyz); |
| | 487 | }}} |
| | 488 | 2. Introduce zoom in/out functionality of the viewer by adding mouse wheel events to the end of `mouse()` |