Question: . First. implement the projection matrix which wilt transform the 3D coordinates into 2D suitable for plotting This is the function project [} . The

. First. implement the projection matrix which wilt transform the 3D coordinates into 2D suitable for plotting This is the function project [} . The camera is at location (what) and is looking toward the xy plane. just E described in the book. The book describes fairly exactly what this projection matrix should be. . Next, use project I: l to create a projection matrix corresponding to putting the 1riewer at location ({l,[},l[l.{l Stop and test . Next, implement the function moveTo (start, end} which takes a starting position and an ending positic and returns the matrix that translates an object from start to end . This shouid be fairly clear from the boo] Test this function by using it to create some matrices and inspect them to make sure they are correct. . Next, create the function rotate (x. y. z. loo} . This function returns the matrix corresponding to r: rotating 1 radians around the raxis, then rotating y radians around the yaxis, and then rotating z radians aroun the zaxis. The center of rotation is at point given by loo. which is in 3D homogeneous coordinates. Use thi to cause the ball to rotate in the proper direction as it moves, so that it looks like it is rolling. Test. . Finally, use rotate (3 to rotate the camera during timesteps it} to ME}, completing one full circle whil pointing toward the origin {and not getting closer or further from the origin}. This is done for you i ballTransformt} , you need to do it in houseTranaform [} Figure 2 shows a snapshot taken durin the rotation process
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
