CMPS160 - Computer Graphics
Joseph Faulkner - josephmfaulkner@gmail.com
This is a program designed to read in two files at a time (.coor and .poly), and display the corresponding 3d objects onto the screen. Objects are to be loaded 2 at a time.
By default, a red cube will appear in the middle of the screen. This was supposed to control the specular light source but I wasn't able to implement it. Instead, the red cube does nothing. Only the Move Tool can be applied to the red cube.
Manipulations: To zoom the camera in and out, scroll the wheel in and out. To move the camera forwards and backwards, click on the middle mouse button and scroll. To pan the view, left click on the background and drag the mouse. To rotate the camera view, right click on the background and drag the mouse. Note that the rotations are locked to one axis at a time. To apply the ActiveTool to an object in the scene, leftclick on the object.
Tools: To move the object, press Q To rotate the object, press W To scale the object, press E To change the object's color, press R To apply a texture to an object, press T
The Move tool translates the object by it's x and y coordinates when the user holds and drags their mouse on the canvas. The Rotate tool rotates the object by it's y axis when the user holds and drags their mouse on the canvas. The Scale tool scales the object uniformly when the user holds and drags their mouse up and down on the canvas. The Change Color tool changes the color of either the Background or the Active Object when the user clicks on it. The Apply Texture tool applies the texture selected from the user to an object the user clicks on.
The user can select between flat, gourad, pong and wireframe shading. The user can also select between using orthogonal and perspective projection. The program uses a white directional light and a blue point light.
To load an object into the scene, click on 'ChooseFiles' where it says 'Load Object' and select a .coor and .poly file.
To choose what color to apply when using the 'Change Color' tool, move the R,G,B values where it says 'Change Color'. The new color to be applied will appear in the colored bar. To apply this color, press 'R' and click on the object you wish to apply it to.
To choose a texture to apply to an object, click on 'ChooseFiles' where it says 'Select Texture', then select the texture you wish to use. To apply this texture to an object, press 'T' and click on the object you want to apply the texture to. You can apply the texture to as many objects as you like and use as many textures in your scene as you like. Make sure you select an image of a reasonable size or else the texture will not work.
As a firm believer in scrupulous testing and debugging, I have included lots of console logs most are commented out but kept in the code should they ever be needed again.
I have tested the code and I know that it works on Google Chrome with the woman and enterprise model.