<-Back to main page

Prog2: Draw a mallet's

Ruiyang Liu, Rliu60@ucsc.edu

Project Overview

In this programing assignment, I will create two cylenders in the 3D world. At default, the number of side is 50, and they are arranged like a mallet. There are also some user interface, you can play around with each cylinder.

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 9. 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 light source locates at [1,1,1], which is the right-front-up corner.

So the bule cylinder's upper part is lighter and red one's right part is lighter.

2)Some sliders are changed randomly, so you can see the cylinders from different angles.

3)When the number of side changed to 4, they are cubes. In this picture, the position of cubes are modified from the default mallet.

It's clear to see the flat shading, each face shares a same normal and color.

4)When the number of side changed to 3. In this picture, the position of cubes are modified from the default mallet.