Reference no: EM132469952
COMP 4302 - 3D Computer Graphics - Memorial University of Newfoundland
Transformations, Navigation and Projections
Assignment Objectives:
LO1: To develop an application which illustrates how transformations are used to change the size, position, orientation and scale of objects in 3D space
LO2: To practice several techniques used to navigate through a 3D environment. To get you to know some of the basic projection styles that can be implemented with WebGL and how to change the parameters of the functions that define them.
Assignment Task:
In this assignment you are asked to write a program where you will be able to affect a model through a series of transformations. To start, you should take a look into the tutorial called "transformation". After that, you are asked to build an interactive program that will respond to keyboard input.
You need to construct a scene consisting of five moving objects. The objects should all be different from each other in shape and color. All objects should be laid on top of a plane (that acts like a stage) and the objects should be animated in such a way that each of these objects is affected by a particular type of transformation. When looking at the scene, it should be clear or obvious to the viewer which transformations are taking place. You should have rotation, translation, uniform scaling (scaling in all directions), scaling along different axis (non-uniform), and back and forth motion (as in an object constantly moving between from point A to point B and back).
Each object's animation should be controlled by its own variable, which allows for each object to move (or stop moving) independently from the others. If the user decides to stop the motion of one object, this should not affect the motion of the other objects. You should use the number keys to toggle animation on each of the objects shown. Check out the tutorial in advance to make sure you understand what you are actually seeing on the screen.
Implement a navigation technique that uses the WASD keys to allow the user to move around the virtual environment.
In addition, your program should give the user the possibility of choosing two different projection types. The first is the perspective view, which is controlled by using the perspective() function. The second view type is the orthographic, which is available through the ortho() function.
To appreciate the difference between the projections, you need to enable keyboard interaction such that the pressing of the key "O" (case insensitive) shows the orthographic view of the scene, while the pressing of the key "P" shows the perspective view of the scene, and you will need to provide some navigation aids for the user through the use of the lookAt() function. Make sure you arrow keys work as navigation aids for both types of projections, but notice that zooming in and out (or getting close and far) requires scaling when using the orthographic projection for it to make sense.
Attachment:- Computer Graphics.rar