diff --git a/.DS_Store b/.DS_Store index 92c2b2f..deb9b54 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/hw4/.DS_Store b/hw4/.DS_Store new file mode 100644 index 0000000..e3fd539 Binary files /dev/null and b/hw4/.DS_Store differ diff --git a/hw4/images/.DS_Store b/hw4/images/.DS_Store new file mode 100644 index 0000000..6b23669 Binary files /dev/null and b/hw4/images/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/.DS_Store b/hw4/images/cs184 hw4 part 2/.DS_Store new file mode 100644 index 0000000..755fcb7 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/default shading/.DS_Store b/hw4/images/cs184 hw4 part 2/default shading/.DS_Store new file mode 100644 index 0000000..d75767e Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/default shading/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/default shading/pinned2_bump.png b/hw4/images/cs184 hw4 part 2/default shading/pinned2_bump.png new file mode 100644 index 0000000..a26281b Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/default shading/pinned2_bump.png differ diff --git a/hw4/images/cs184 hw4 part 2/default shading/pinned4_bump.png b/hw4/images/cs184 hw4 part 2/default shading/pinned4_bump.png new file mode 100644 index 0000000..acc530b Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/default shading/pinned4_bump.png differ diff --git a/hw4/images/cs184 hw4 part 2/default shading/pinned4_wireframe.png b/hw4/images/cs184 hw4 part 2/default shading/pinned4_wireframe.png new file mode 100644 index 0000000..f50f734 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/default shading/pinned4_wireframe.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/.DS_Store b/hw4/images/cs184 hw4 part 2/pinned2 damping/.DS_Store new file mode 100644 index 0000000..40608b1 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_damping_default.gif b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_damping_default.gif new file mode 100644 index 0000000..1aa3fe5 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_damping_default.gif differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_damping_default.mov b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_damping_default.mov new file mode 100644 index 0000000..8c8ae8a Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_damping_default.mov differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_default.png b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_default.png new file mode 100644 index 0000000..8ae0383 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.2_default.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.32.png b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.32.png new file mode 100644 index 0000000..c33fe72 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.32.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.5_damping.gif b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.5_damping.gif new file mode 100644 index 0000000..d1c94f3 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.5_damping.gif differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.5_damping.mov b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.5_damping.mov new file mode 100644 index 0000000..d58fcc2 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.5_damping.mov differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.81.png b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.81.png new file mode 100644 index 0000000..2739dbb Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.81.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0.png b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.png new file mode 100644 index 0000000..a120f05 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0_damping.gif b/hw4/images/cs184 hw4 part 2/pinned2 damping/0_damping.gif new file mode 100644 index 0000000..43156ee Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0_damping.gif differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/0_damping.mov b/hw4/images/cs184 hw4 part 2/pinned2 damping/0_damping.mov new file mode 100644 index 0000000..36b7198 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/0_damping.mov differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/1.png b/hw4/images/cs184 hw4 part 2/pinned2 damping/1.png new file mode 100644 index 0000000..dff5161 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/1.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/1_damping.gif b/hw4/images/cs184 hw4 part 2/pinned2 damping/1_damping.gif new file mode 100644 index 0000000..6b2be76 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/1_damping.gif differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 damping/1_damping.mov b/hw4/images/cs184 hw4 part 2/pinned2 damping/1_damping.mov new file mode 100644 index 0000000..d1f2095 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 damping/1_damping.mov differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/.DS_Store b/hw4/images/cs184 hw4 part 2/pinned2 density/.DS_Store new file mode 100644 index 0000000..8a41ac0 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/10.png b/hw4/images/cs184 hw4 part 2/pinned2 density/10.png new file mode 100644 index 0000000..dc3d1e0 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/10.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/100.png b/hw4/images/cs184 hw4 part 2/pinned2 density/100.png new file mode 100644 index 0000000..2834d93 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/100.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/10000.png b/hw4/images/cs184 hw4 part 2/pinned2 density/10000.png new file mode 100644 index 0000000..087ba46 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/10000.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/15.png b/hw4/images/cs184 hw4 part 2/pinned2 density/15.png new file mode 100644 index 0000000..f58bda4 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/15.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/2.png b/hw4/images/cs184 hw4 part 2/pinned2 density/2.png new file mode 100644 index 0000000..7e37045 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/2.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/30.png b/hw4/images/cs184 hw4 part 2/pinned2 density/30.png new file mode 100644 index 0000000..3b3d98e Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/30.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 density/5.png b/hw4/images/cs184 hw4 part 2/pinned2 density/5.png new file mode 100644 index 0000000..4d6ebc6 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 density/5.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 ks/.DS_Store b/hw4/images/cs184 hw4 part 2/pinned2 ks/.DS_Store new file mode 100644 index 0000000..b839981 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 ks/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 ks/50.png b/hw4/images/cs184 hw4 part 2/pinned2 ks/50.png new file mode 100644 index 0000000..65e4831 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 ks/50.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 ks/500.png b/hw4/images/cs184 hw4 part 2/pinned2 ks/500.png new file mode 100644 index 0000000..f7f9cdb Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 ks/500.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 ks/5000.png b/hw4/images/cs184 hw4 part 2/pinned2 ks/5000.png new file mode 100644 index 0000000..c2a5904 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 ks/5000.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned2 ks/50000.png b/hw4/images/cs184 hw4 part 2/pinned2 ks/50000.png new file mode 100644 index 0000000..dd98c1b Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned2 ks/50000.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/.DS_Store b/hw4/images/cs184 hw4 part 2/pinned4 density/.DS_Store new file mode 100644 index 0000000..3965972 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/10.png b/hw4/images/cs184 hw4 part 2/pinned4 density/10.png new file mode 100644 index 0000000..870d44d Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/10.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/100.png b/hw4/images/cs184 hw4 part 2/pinned4 density/100.png new file mode 100644 index 0000000..7c5332a Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/100.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/1000.png b/hw4/images/cs184 hw4 part 2/pinned4 density/1000.png new file mode 100644 index 0000000..eb5ead5 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/1000.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/15.png b/hw4/images/cs184 hw4 part 2/pinned4 density/15.png new file mode 100644 index 0000000..536c7a9 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/15.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/2.png b/hw4/images/cs184 hw4 part 2/pinned4 density/2.png new file mode 100644 index 0000000..740f19d Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/2.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 density/50.png b/hw4/images/cs184 hw4 part 2/pinned4 density/50.png new file mode 100644 index 0000000..e6f0fb0 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 density/50.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 ks/.DS_Store b/hw4/images/cs184 hw4 part 2/pinned4 ks/.DS_Store new file mode 100644 index 0000000..88eb7e3 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 ks/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 ks/50.png b/hw4/images/cs184 hw4 part 2/pinned4 ks/50.png new file mode 100644 index 0000000..25b6721 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 ks/50.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 ks/500.png b/hw4/images/cs184 hw4 part 2/pinned4 ks/500.png new file mode 100644 index 0000000..a43307d Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 ks/500.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 ks/5000.png b/hw4/images/cs184 hw4 part 2/pinned4 ks/5000.png new file mode 100644 index 0000000..e9adb05 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 ks/5000.png differ diff --git a/hw4/images/cs184 hw4 part 2/pinned4 ks/50000.png b/hw4/images/cs184 hw4 part 2/pinned4 ks/50000.png new file mode 100644 index 0000000..b024a61 Binary files /dev/null and b/hw4/images/cs184 hw4 part 2/pinned4 ks/50000.png differ diff --git a/hw4/images/cs184 hw4 part 3/.DS_Store b/hw4/images/cs184 hw4 part 3/.DS_Store new file mode 100644 index 0000000..5bcdc82 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 3/500.gif b/hw4/images/cs184 hw4 part 3/500.gif new file mode 100644 index 0000000..e0a1669 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/500.gif differ diff --git a/hw4/images/cs184 hw4 part 3/500.mov b/hw4/images/cs184 hw4 part 3/500.mov new file mode 100644 index 0000000..91d0a24 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/500.mov differ diff --git a/hw4/images/cs184 hw4 part 3/500.png b/hw4/images/cs184 hw4 part 3/500.png new file mode 100644 index 0000000..2707b85 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/500.png differ diff --git a/hw4/images/cs184 hw4 part 3/5000.gif b/hw4/images/cs184 hw4 part 3/5000.gif new file mode 100644 index 0000000..3b6f410 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/5000.gif differ diff --git a/hw4/images/cs184 hw4 part 3/5000.mov b/hw4/images/cs184 hw4 part 3/5000.mov new file mode 100644 index 0000000..5199e7e Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/5000.mov differ diff --git a/hw4/images/cs184 hw4 part 3/5000.png b/hw4/images/cs184 hw4 part 3/5000.png new file mode 100644 index 0000000..e49e2cd Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/5000.png differ diff --git a/hw4/images/cs184 hw4 part 3/50000.gif b/hw4/images/cs184 hw4 part 3/50000.gif new file mode 100644 index 0000000..7334894 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/50000.gif differ diff --git a/hw4/images/cs184 hw4 part 3/50000.mov b/hw4/images/cs184 hw4 part 3/50000.mov new file mode 100644 index 0000000..dae3eb8 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/50000.mov differ diff --git a/hw4/images/cs184 hw4 part 3/50000.png b/hw4/images/cs184 hw4 part 3/50000.png new file mode 100644 index 0000000..de28338 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/50000.png differ diff --git a/hw4/images/cs184 hw4 part 3/plane.gif b/hw4/images/cs184 hw4 part 3/plane.gif new file mode 100644 index 0000000..f3952f3 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/plane.gif differ diff --git a/hw4/images/cs184 hw4 part 3/plane.mov b/hw4/images/cs184 hw4 part 3/plane.mov new file mode 100644 index 0000000..39ac104 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/plane.mov differ diff --git a/hw4/images/cs184 hw4 part 3/plane.png b/hw4/images/cs184 hw4 part 3/plane.png new file mode 100644 index 0000000..eb33811 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/plane.png differ diff --git a/hw4/images/cs184 hw4 part 3/plane_1.png b/hw4/images/cs184 hw4 part 3/plane_1.png new file mode 100644 index 0000000..435c85d Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/plane_1.png differ diff --git a/hw4/images/cs184 hw4 part 3/plane_2.png b/hw4/images/cs184 hw4 part 3/plane_2.png new file mode 100644 index 0000000..a5b4717 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/plane_2.png differ diff --git a/hw4/images/cs184 hw4 part 3/sphere_1.png b/hw4/images/cs184 hw4 part 3/sphere_1.png new file mode 100644 index 0000000..56ae471 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/sphere_1.png differ diff --git a/hw4/images/cs184 hw4 part 3/sphere_2.png b/hw4/images/cs184 hw4 part 3/sphere_2.png new file mode 100644 index 0000000..4df8b72 Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/sphere_2.png differ diff --git a/hw4/images/cs184 hw4 part 3/sphere_3.png b/hw4/images/cs184 hw4 part 3/sphere_3.png new file mode 100644 index 0000000..94307cd Binary files /dev/null and b/hw4/images/cs184 hw4 part 3/sphere_3.png differ diff --git a/hw4/images/cs184 hw4 part 4/.DS_Store b/hw4/images/cs184 hw4 part 4/.DS_Store new file mode 100644 index 0000000..7335169 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/.DS_Store differ diff --git a/hw4/images/cs184 hw4 part 4/100_density.gif b/hw4/images/cs184 hw4 part 4/100_density.gif new file mode 100644 index 0000000..76478df Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_density.gif differ diff --git a/hw4/images/cs184 hw4 part 4/100_density.mov b/hw4/images/cs184 hw4 part 4/100_density.mov new file mode 100644 index 0000000..7ee70a7 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_density.mov differ diff --git a/hw4/images/cs184 hw4 part 4/100_density_1.png b/hw4/images/cs184 hw4 part 4/100_density_1.png new file mode 100644 index 0000000..5043e5b Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_density_1.png differ diff --git a/hw4/images/cs184 hw4 part 4/100_density_2.png b/hw4/images/cs184 hw4 part 4/100_density_2.png new file mode 100644 index 0000000..0a21931 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_density_2.png differ diff --git a/hw4/images/cs184 hw4 part 4/100_density_3.png b/hw4/images/cs184 hw4 part 4/100_density_3.png new file mode 100644 index 0000000..f117c84 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_density_3.png differ diff --git a/hw4/images/cs184 hw4 part 4/100_ks.gif b/hw4/images/cs184 hw4 part 4/100_ks.gif new file mode 100644 index 0000000..656422f Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_ks.gif differ diff --git a/hw4/images/cs184 hw4 part 4/100_ks.mov b/hw4/images/cs184 hw4 part 4/100_ks.mov new file mode 100644 index 0000000..013d275 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/100_ks.mov differ diff --git a/hw4/images/cs184 hw4 part 4/15_density.gif b/hw4/images/cs184 hw4 part 4/15_density.gif new file mode 100644 index 0000000..0a4d04a Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/15_density.gif differ diff --git a/hw4/images/cs184 hw4 part 4/15_density.mov b/hw4/images/cs184 hw4 part 4/15_density.mov new file mode 100644 index 0000000..1cae411 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/15_density.mov differ diff --git a/hw4/images/cs184 hw4 part 4/2_density.gif b/hw4/images/cs184 hw4 part 4/2_density.gif new file mode 100644 index 0000000..c3dff5d Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/2_density.gif differ diff --git a/hw4/images/cs184 hw4 part 4/2_density.mov b/hw4/images/cs184 hw4 part 4/2_density.mov new file mode 100644 index 0000000..15b43ef Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/2_density.mov differ diff --git a/hw4/images/cs184 hw4 part 4/2_density_1.png b/hw4/images/cs184 hw4 part 4/2_density_1.png new file mode 100644 index 0000000..2fc74bc Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/2_density_1.png differ diff --git a/hw4/images/cs184 hw4 part 4/2_density_2.png b/hw4/images/cs184 hw4 part 4/2_density_2.png new file mode 100644 index 0000000..31cd455 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/2_density_2.png differ diff --git a/hw4/images/cs184 hw4 part 4/2_density_3.png b/hw4/images/cs184 hw4 part 4/2_density_3.png new file mode 100644 index 0000000..e033c19 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/2_density_3.png differ diff --git a/hw4/images/cs184 hw4 part 4/50000_ks.gif b/hw4/images/cs184 hw4 part 4/50000_ks.gif new file mode 100644 index 0000000..4caeb42 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/50000_ks.gif differ diff --git a/hw4/images/cs184 hw4 part 4/50000_ks.mov b/hw4/images/cs184 hw4 part 4/50000_ks.mov new file mode 100644 index 0000000..08fd607 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/50000_ks.mov differ diff --git a/hw4/images/cs184 hw4 part 4/500_ks.gif b/hw4/images/cs184 hw4 part 4/500_ks.gif new file mode 100644 index 0000000..c9e13f6 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/500_ks.gif differ diff --git a/hw4/images/cs184 hw4 part 4/500_ks.mov b/hw4/images/cs184 hw4 part 4/500_ks.mov new file mode 100644 index 0000000..051660f Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/500_ks.mov differ diff --git a/hw4/images/cs184 hw4 part 4/before.mov b/hw4/images/cs184 hw4 part 4/before.mov new file mode 100644 index 0000000..366b671 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/before.mov differ diff --git a/hw4/images/cs184 hw4 part 4/default_1.png b/hw4/images/cs184 hw4 part 4/default_1.png new file mode 100644 index 0000000..f9eb2b9 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/default_1.png differ diff --git a/hw4/images/cs184 hw4 part 4/default_2.png b/hw4/images/cs184 hw4 part 4/default_2.png new file mode 100644 index 0000000..a7c9657 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/default_2.png differ diff --git a/hw4/images/cs184 hw4 part 4/default_3.png b/hw4/images/cs184 hw4 part 4/default_3.png new file mode 100644 index 0000000..ee7648a Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/default_3.png differ diff --git a/hw4/images/cs184 hw4 part 4/default_4.png b/hw4/images/cs184 hw4 part 4/default_4.png new file mode 100644 index 0000000..4790c6c Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/default_4.png differ diff --git a/hw4/images/cs184 hw4 part 4/default_5.png b/hw4/images/cs184 hw4 part 4/default_5.png new file mode 100644 index 0000000..039c1a3 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/default_5.png differ diff --git a/hw4/images/cs184 hw4 part 4/default_6.png b/hw4/images/cs184 hw4 part 4/default_6.png new file mode 100644 index 0000000..ed2e792 Binary files /dev/null and b/hw4/images/cs184 hw4 part 4/default_6.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-ambient.png b/hw4/images/cs184 hw4 part 5/p5-ambient.png new file mode 100644 index 0000000..bc4011b Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-ambient.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-bump-128.png b/hw4/images/cs184 hw4 part 5/p5-bump-128.png new file mode 100644 index 0000000..dcfbeb1 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-bump-128.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-bump-16-2.png b/hw4/images/cs184 hw4 part 5/p5-bump-16-2.png new file mode 100644 index 0000000..7366564 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-bump-16-2.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-bump-16.png b/hw4/images/cs184 hw4 part 5/p5-bump-16.png new file mode 100644 index 0000000..fae2849 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-bump-16.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-diffuse.png b/hw4/images/cs184 hw4 part 5/p5-diffuse.png new file mode 100644 index 0000000..6eb08f8 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-diffuse.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-displacement-128.png b/hw4/images/cs184 hw4 part 5/p5-displacement-128.png new file mode 100644 index 0000000..50d2c71 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-displacement-128.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-displacement-16.png b/hw4/images/cs184 hw4 part 5/p5-displacement-16.png new file mode 100644 index 0000000..bbbf7fa Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-displacement-16.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-mirror-sphere.png b/hw4/images/cs184 hw4 part 5/p5-mirror-sphere.png new file mode 100644 index 0000000..3e0bb76 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-mirror-sphere.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-mirror.png b/hw4/images/cs184 hw4 part 5/p5-mirror.png new file mode 100644 index 0000000..819a284 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-mirror.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-phong.png b/hw4/images/cs184 hw4 part 5/p5-phong.png new file mode 100644 index 0000000..d4e295e Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-phong.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-specular.png b/hw4/images/cs184 hw4 part 5/p5-specular.png new file mode 100644 index 0000000..2b07004 Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-specular.png differ diff --git a/hw4/images/cs184 hw4 part 5/p5-texture.png b/hw4/images/cs184 hw4 part 5/p5-texture.png new file mode 100644 index 0000000..5e2eb6a Binary files /dev/null and b/hw4/images/cs184 hw4 part 5/p5-texture.png differ diff --git a/hw4/images/p1-2.png b/hw4/images/p1-2.png new file mode 100644 index 0000000..6e3f73a Binary files /dev/null and b/hw4/images/p1-2.png differ diff --git "a/hw4/images/p1-Screenshot 2024-04-01 at 6.33.21\342\200\257PM.png" "b/hw4/images/p1-Screenshot 2024-04-01 at 6.33.21\342\200\257PM.png" new file mode 100644 index 0000000..1645e3c Binary files /dev/null and "b/hw4/images/p1-Screenshot 2024-04-01 at 6.33.21\342\200\257PM.png" differ diff --git a/hw4/images/p1-all-constraints.png b/hw4/images/p1-all-constraints.png new file mode 100644 index 0000000..8223378 Binary files /dev/null and b/hw4/images/p1-all-constraints.png differ diff --git a/hw4/images/p1-angle.png b/hw4/images/p1-angle.png new file mode 100644 index 0000000..7ca3269 Binary files /dev/null and b/hw4/images/p1-angle.png differ diff --git a/hw4/images/p1-no-shearing.png b/hw4/images/p1-no-shearing.png new file mode 100644 index 0000000..a181923 Binary files /dev/null and b/hw4/images/p1-no-shearing.png differ diff --git a/hw4/images/p1-with-shearing.png b/hw4/images/p1-with-shearing.png new file mode 100644 index 0000000..fb3e7b5 Binary files /dev/null and b/hw4/images/p1-with-shearing.png differ diff --git a/hw4/images/title_pic.png b/hw4/images/title_pic.png new file mode 100644 index 0000000..998764a Binary files /dev/null and b/hw4/images/title_pic.png differ diff --git a/hw4/index.html b/hw4/index.html index c1ca00c..2f19ff7 100644 --- a/hw4/index.html +++ b/hw4/index.html @@ -1,7 +1,424 @@ - - - - - Homework 4 index.html here - - \ No newline at end of file + + + + +CS 184 Cloth Sim + + + + + + + + + + + +

CS 184: Computer Graphics and Imaging, Spring 2024

+

Project 4: Cloth Sim

+

Snehaa Ganesh Kumar and Manan Bhargava

+ + +

Website URL

+ +
+ +
+ + + + +
+ +
+
+ + +
+ +

Overview

+

+ In this project, we began with implementing the point mass and spring simulation. We developed a grid of masses and springs to create the initial cloth that would illustrate the structural, shearing, and bending forces. We then moved on to developing the simulation for pinning 2 and 4 corners of the cloth, and illustrating how the cloth was dropped from its initial starting position. Through this, we were able to visualize the various forces at play when gravity is applied to all the point masses and springs, and the forces that are distributed and acted upon between the point masses and springs. It was incredible to see the cloth gracefully drop from the two corners of being pinned downwards with gravity applied. Then, looking at handling the case where the cloth is having a collision with a sphere illustrates the unique geometry present when draping the cloth over a spherical object, which looks extremely realistic to the real version of a cloth being draped on a spherical object. Analyzing different densities of cloths and the strength of springs illustrated the effect of the tensile force of the material, and how this also ties into the cloth folding on top of itself when self-colliding. Finally, implementing shaders illustrated the effects of various types of shading, and the underlying equations behind various aspects of light hitting the material or the texture mapping of the material — specifically with phong shading illustrating the ambient, diffuse, and specular lighting. +

+

Overall, this project was incredibly rewarding for serving as an illustration of physics in the real-world, applied through a simulation and demonstrating the forces as well as the lighting in shading. Debugging was challenging in ClothSim, specifically through the implementation of various mathematical formulas. This translated into the coding process creating a binary scenario where the intended properties or effects in the simulation either don’t work, or work immediately. Specifically for shading, understanding the visual aspects of various types of shading with the cloth and sphere was incredibly cool.

+
+ +

Part 1: Masses and Springs (20 Points)

+ + +

+ Take some screenshots of scene/pinned 2.json from a viewing angle where you can clearly see the cloth wireframe to show the structure of your point masses and springs. +

+ +
+ + + + + +
+ + + + + +
+
+
+
+
+ +

Part 2: Simulation via Numerical Integration (20 Points)

+ +

Impact of Ks on Cloth Behavior:

+

Higher ks (Spring Stiffness): When the spring stiffness coefficient (ks) is increased, the springs within the cloth simulation become more resistant to deformation. This results in a cloth that appears stiffer and less prone to bending, since the pinned cloth is illustrated with less “droopiness”. The increased stiffness gives a more rigid and extended appearance.

+

Lower ks (Spring Stiffness): Conversely, decreasing the spring stiffness coefficient (ks) makes the springs more elastic and flexible. This elasticity allows the cloth to bend and fold more readily, leading to a cloth simulation characterized by increased creases and a looser look from having 2 corners pinned.

+ + +
+ + + + + + + +
+ +
ks = 50 N/m
+
+ +
ks = 500 N/m
+
+ +
ks = 5,000 N/m
+
+ +
ks = 50,000 N/m
+
+
+
+ +

Impact of Density on Cloth Behavior:

+

Lowering Density: When the density of the cloth is decreased, the overall mass of the cloth becomes lighter. Since the force of gravity acting on an object is directly proportional to its mass (F = m * g, where F is the force due to gravity, m is mass, and g is the acceleration due to gravity), a decrease in mass results in a decrease in the gravitational force applied to the cloth. Consequently, the cloth experiences a gentler pull towards the ground, leading to a slower "falling" motion. This can simulate lighter materials or cloths under less gravitational influence.

+

Raising Density: Conversely, increasing the cloth's density makes it heavier. The increased mass leads to a stronger gravitational pull on the cloth, causing it to fall faster. This behavior is consistent with heavier fabrics or scenarios where the cloth is subjected to stronger gravitational forces, making it more quickly succumb to gravity.

+ +
+ + + + + + + + + + + + + + + +
+ +
density = 2 g/cm^2
+
+ +
density = 5 g/cm^2
+
+ +
density = 10 g/cm^2
+
+ +
density = 15 g/cm^2
+
+ +
density = 15 g/cm^2
+
+ +
density = 30 g/cm^2
+
+ +
density = 100 g/cm^2
+
+ +
density = 10,000 g/cm^2
+
+
+
+ +

Impact of Damping on Cloth Behavior:

+

Lowering Damping Factor: The damping factor in a simulation acts to reduce the velocity of the cloth over time, simulating the effects of air resistance and internal friction. Lowering the damping factor reduces the effect of this velocity reduction, allowing the cloth to maintain its speed for longer. As a result, with a lower damping factor, the cloth falls faster from its initial state, as less energy is lost to damping forces. This can simulate conditions with less air resistance or internal material friction. This is shown through the calculation of the velocity, Vector3D velocity = (1 - d) * (pm.position - pm.last_position) with the relationship of how adjusting the value of d affects the velocity.

+

Raising Damping Factor: Increasing the damping factor enhances the velocity reduction effect, causing the cloth to lose speed more rapidly. This leads to a slower, more graceful descent, as if the cloth is falling through a medium with greater resistance (e.g., thicker air) or as if the material itself has higher internal friction. The increased damping makes the cloth's movement appear more fluid and natural, especially in environments where air resistance plays a significant role.

+ + +
+ + + + + + + +
+ +
damping = 0%
+
+ +
damping = 0.2%
+
+ +
damping = 0.5%
+
+ +
damping = 1%
+
+
+
+ +
+ + + + + +
+ +
Shaded Pinned 2 Cloth, Default Parameters
+
+ +
Shaded Pinned 4 Cloth, Default Parameters
+
+
+
+ +

The adjustments to the density and damping factor directly influence the calculation of the cloth's new position (Vector3D new_position = pm.position + velocity + (acceleration * delta_t_squared)). By altering the velocity and acceleration applied to each point mass within the cloth, these parameters modify the cloth's trajectory and behavior under gravity. This results in a dynamic simulation that can be fine-tuned to replicate a wide range of physical conditions and material properties, allowing for realistic animation of cloth behavior in virtual environments.

+ +

Part 3: Handling Collisions with Other Objects (20 Points)

+ +

We implemented the collision with other objects in the following process for the sphere collide method:

+

1. Direction Calculation: The function starts by calculating the vector (direction) from the sphere's origin to the point mass's current position.

+

2. Inside Sphere Check: Use the direction vector to calculate whether the point mass is inside the sphere. This is done by comparing the squared magnitude of the direction vector (direction.norm2()) with the squared radius of the sphere (this->radius2). Using squared values avoids the computational cost of a square root operation.

+

3. If there is a collision, then calculate the tangent point, calculate the correction vector based on the tangent point and the point mass’s last position, apply the friction to the correction vector, and update the point mass position to the sum of the last position and the correction vector.

+

We implemented the collision with other objects in the following process for the plane collision method with a similar approach.

+
+

We implemented the collision with other objects in cloth.cpp in the simulate function through:

+

Nested iteration for each point mass in point masses, for each collision object in the list of collision objects.

+

In the nested iteration, run the collide method of the object on the point mass. This ensures that the collision with respect to whichever object geometry, whether it is the sphere or plane, is applied to each point mass correctly for all collision objects for all point masses.

+ +
+ + + + + + +
+ +
ks = 500 N/m
+
+ +
ks = 5000 N/m
+
+ +
ks = 50000 N/m
+
+
+
+ +

Impact of Ks on Cloth Behavior

+

Higher ks (Spring Stiffness): When the spring stiffness coefficient (ks) is increased, the springs within the cloth simulation become more resistant to deformation. This results in a cloth that appears stiffer and less prone to bending, manifesting in fewer creases and a broader drape over objects. The increased stiffness prevents the cloth from closely conforming to underlying shapes, giving it a more rigid and extended appearance.

+

Lower ks (Spring Stiffness): Conversely, decreasing the spring stiffness coefficient (ks) makes the springs more elastic and flexible. This elasticity allows the cloth to bend and fold more readily, leading to a cloth simulation characterized by increased creases and a tighter drape over objects. The decreased stiffness enables the cloth to more accurately and closely follow the contours of underlying shapes, resulting in a more detailed and realistic simulation of cloth behavior.

+ +
+ + + + +
+ +
Our Shaded Cloth, Peacefully at Rest
+
+
+
+ +

Part 4: Handling Self-Collisions (20 Points)

+ +

Varying Density of Cloth

+

Lower Density: At reduced density levels, the cloth exhibits a more graceful and slower descent. The reduced mass results in weaker gravitational pull, allowing the cloth to float and drape with minimal folding. This behavior mimics lightweight fabrics that tend to spread out and settle gently, showing fewer tendencies to fold significantly upon themselves.

+

Higher Density: As the density increases, the cloth's behavior markedly changes. It falls more swiftly due to the increased gravitational force acting on the greater mass. This rapid descent leads to more pronounced interactions with itself and any obstacles, resulting in more frequent and tighter folds. The cloth, behaving akin to heavier fabric, gathers and folds upon itself, creating complex folding patterns as it settles.

+ +

Varying Ks of Cloth

+

Lower ks: Decreasing the spring constant effectively reduces the stiffness of the cloth, making it more susceptible to bending and crumpling. In this state, the cloth exhibits a pronounced tendency to fold upon itself, especially when encountering external forces or obstacles. The reduced resistance to deformation allows the cloth to crumple more readily, leading to a faster accumulation of folds and a more compact final state. This behavior is reminiscent of softer, more pliable fabrics that easily drape and conform to the shapes beneath them.

+

Higher ks: Increasing the spring constant introduces a higher degree of stiffness to the cloth, resisting bending and maintaining a more uniform structure during its descent. The enhanced rigidity prevents the cloth from easily folding upon itself, leading to a smoother and more controlled fall. Even as the cloth settles, it retains a more open and spread-out configuration, with fewer and less pronounced folds. This mimics the behavior of stiffer fabrics that hold their shape and resist crumpling.

+ + +
+ + + + + + + + + + + + + + + + +
+ +
Density = 100, Initial State
+
+ +
Density = 100, After Collapse
+
+ +
Density = 100, Final State
+
+ +
Density = 2 g/cm^2
+
+ +
Density = 15 g/cm^2
+
+ +
Density = 100 g/cm^2
+
+ +
ks = 100 N/m
+
+ +
ks = 500 N/m
+
+ +
ks = 50,000 N/m
+
+
+
+ +

Part 5: Shaders (20 Points)

+ +

Explain in your own words what a shader program is and how vertex and fragment shaders work together to create lighting and material effects.

+

A shader program is a set of instructions that dictate how graphics are rendered on the screen, particularly how vertices and pixels (fragments) should be processed. The vertex shader manages the shape and position of objects, transforming 3D coordinates to 2D coordinates, while applying calculations for lighting effects that are consistent across a surface. The fragment shader, on the other hand, controls the pixel-level details, such as color, texture, and lighting, to create the final visual effects you see on each pixel of an object.

+
+ +

Explain the Blinn-Phong shading model in your own words.

+

The Blinn-Phong shading model is an enhancement to the Phong shading model. It simplifies the way light reflects on surfaces, making it computationally less intensive. This model calculates the light reflection by using the halfway vector between the viewer's line of sight and the light source's direction, instead of the reflection vector used in Phong shading. This allows for a more realistic portrayal of light on shiny surfaces while reducing the processing power needed to render the scene.

+
+ +
+ + + + + + + +
+ +
Blinn-Phong, Ambient Component
+
+ +
Blinn-Phong, Diffuse Component
+
+ +
Blinn-Phong, Specular Component
+
+ +
Blinn-Phong, All Components
+
+
+
+ +
+ + + + +
+ +
Custom Texture
+
+
+
+ +

When analyzing the effect of shader coarseness on bump and displacement mapping, it's evident that a higher sample density allows for more accurate and detailed rendering. With a low sample density, as in the 16x16 example shown below, displacement mapping can't capture the fine details present in the texture, leading to a blocky and distorted appearance. However, as the sample density increases to 128x128, displacement mapping becomes effective at reproducing the high-frequency details, providing a textured appearance that aligns with the visual cues from the texture map itself.

+ +
+ + + + + + + + + +
+ +
Bump Map - 16x16
+
+ +
Displacement Map - 16x16
+
+ +
Bump Map - 128x128
+
+ +
Displacement Map - 128x128
+
+
+
+ +
+ + + + + +
+ +
Mirror Shader Initial State
+
+ +
Mirror Shader Collision
+
+
+
+ + + + +