Question: You are pushing a unit cube. Initially the cube is centered at (0, 0, 0) and you install a LookAt at (0, 0, 5) looking

You are pushing a unit cube. Initially the cube is centered at (0, 0, 0) and you install a LookAt at (0, 0, 5) looking at it. You install an appropriate orthographic projection. Your cube keeps rotating at its center about the y-axis, with 30o every time. Now let us add some interactions. Use the key a to push the cube forward along the zaxis and use the key z to pull the cube back along the z-axis. You decide the distance for each move. Every time you move the cube, you also need to adjust LookAt and possibly projection such that the distance between your eye and the cube is constant, i.e., no change. During the above moving process, if you press the right mouse button and keep pressed, your LookAt changes to (5, 5, z). If you release the button, the LookAt returns to (0, 0, z). For both situations, z depends on the current z location of the cube. During the above moving process, if you press the left mouse button and keep it pressed, your LookAt changes to (5, 5, 5). If you release the button, the LookAt change back to (0, 0, z), where z is the last z location of the cube. Your cube is always rotating about the y-axis. Your eye always looks at the center of the cube. You decide a proper up vector. Your program should be called lastname.c or lastname.cc, where lastname is your last name. Also create a make file called lastnameMake, such that the marker can compile your program and check it

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!