Add to your image a cube that partially 'overlaps' with the sphere. Your program should allow a user to press the key 's' or 'S' to move the sphere forward ( to the front ) or backward respectively so that it may partially block the cube or the cube may partially block the sphere depending on their z value. ( Note that you need to "glEnable ( GL_DEPTH_TEST )".
| C = | ![]() |
1 2 0 3 0 1 1 4 2 5 1 8 3 2 2 7 |
![]() |
, | D = | ![]() |
1 3 0 1 0 1 1 2 2 5 1 6 2 1 2 5 |
![]() |
|
|
b) Render a scene consisting of a sphere and a shadow like the one shown below: