Prog3: Lighting

Ruiyang Liu, Rliu60@ucsc.edu

Project Overview

In this programing assignment, I will create two cylenders in the 3D world. Then user can select different light sources and light effects. User can switch between 1) wireframe, flat shading, smooth(Gouraud) shading 2) point light or/and directional light 3) turn on/off each lighting component 4) You can also moving point light source.

User Guide

NOTICE: You can change the number of sides if you want to. But this operation is not available on the website directly. (I believe it's optional). You can do this by change the value of "num_ver" on cube.js, line 19. The default value is 50.

Program approach/logic:

Example output

1)default output when you change nothing. You should be able to see this when website opened

The point light source locates at [0,0,0], you need to move it to see the lighting.

Point light's position is changed. You can see both point lighting and directional lighting.

wireframe and flat shading:

Both light sources are ON, and Both light sources are OFF:

Only directional light , and Only point light:

Turn ON/OFF some lighting effect

Ambient light tuened off, and diffuse light turned off.