Info

Program 4. Niall Tessier-Lavigne - 1569279 - ntessier@ucsc.edu


Link to program: Program 4


High-level overview

This program provides the user with the functionality to create and render a surface-of-revolution object. In addition, users may save the SOR to a file or load an SOR from a file. It handles a single SOR at any time.

This program builds on lab 4. Users can zoom in / out the camera view by changing its FOV, move the location of the camera along the Z plane (dollying), and pan the camera on the XY world plane.

Users may also enable a wobbling animation on all SORS in display mode.


User guide

Toggle between create and display mode using the mode button below the canvas.

Toggle between smooth (Gouraud) and flat shading using the "Smooth shading" toggle.

In create mode, create a polyline using a sequence of left clicks on the right hand side of the screen, followed by a single right click to terminate the line. A further right click creates an SOR. The SOR file may be subsequently saved using the filename specifier and save button below.

In display mode, load in SOR .obj files to display by using the file picker below the screen, then pressing the "Load" button.

Switching from display to create mode clears the screen to allow a new SOR to be created.

When viewing an SOR, clicking on the yellow cube will toggle between the point light being enabled or disabled.

When viewing an SOR, clicking on the red line will toggle between the directional light being enabled or disabled.

When an object is selected: Left mouse drag translates in X/Y world, middle mouse drag translates in Z world, right mouse drag rotates across X/Y planes depending on direction of mouse movement.

With no object selected: Left click and drag to pan in X/Y world plane. Scroll middle mouse to change FOV. Click and hold middle mouse while scrolling to change camera's world Z position, thus dollying in / out of the world.

Toggle wobbling animation in display mode by enabling or disabling the 'Wobble' checkbox.


Features

Notes for Program 4

Texturing pulls a random image from the set of 12 included with this program and assigns it to an SOR on creation.

Wobbling is implemented using simple sine-wave driven vertex animation.

Wobbling will appear to split apart SORs per-quad in non-smooth-shaded mode. This is due to vertex normals being assigned to their face normals for basic shading. This is fixed by switching to smooth shading.


Screenshots