Skip to content

hzhang1902/webgl-sculpture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebGL Sculpture

A rotating 3D sculpture under a spotlight, using WebGL. https://hzhang1902.github.io/webgl-sculpture/index.html

Play

Open main.html

  • press 'p' to shrink spotlight size.

  • press 'i' to increase spotlight size.

  • press 'm' for gouraud shading.

  • press 'n' for flat shading.

  • press 'a' to toggle shadow on/off.

  • press 'b' to toggle background texture on/off.

  • press 'c' to toggle object reflection on/off.

  • press 'd' to toggle object refraction on/off.

Features

  1. The edge of the spotlight is blurred to simulate a real spotlight.

  2. Check if triangle facing against light source, if so, kill specular. Because specular doesn't check normal, it will still show even if it is behind the entire shape.

  3. Special shadow in vertex shader from line 50, not using the matrix mentioned in class. It uses a function which gets the intersection of a plane and a vector (in this case, floor/wall plane and Light->Point vector), use all the intersections to draw the shadow polygon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published