This project contains a WebGL 2.0 program that displays two cubes with shared interface controls. The cubes can be rotated, and various parameters affecting shading, including light position, can be adjusted. Additionally, the projection can be toggled between parallel and perspective.
shaders
: Folder containing vertex and fragment shaders for the cubes.js
: Folder containing the main JavaScript file (main.js
).index.html
: HTML file for the web page, including Bootstrap for UI elements.style.css
: CSS file for styling.README.md
: This readme file.
- The vertex and fragment shaders combine rotations for both cubes.
- Interface elements control rotations, light position, and shading parameters.
- Projection can be toggled between parallel and perspective.
- Open
index.html
in a WebGL 2.0 supported browser. - Interact with the controls to see the cubes' behavior.
- Shaders adapted from the class examples.
- Bootstrap is used for UI elements.
Feel free to explore and modify the code to suit your needs.