An interactive ray tracing simulation built with JavaScript and HTML5 Canvas. This simulator allows users to visualize the behavior of light rays interacting with different objects, including reflective and absorptive surfaces.
- Real-time ray tracing with adjustable parameters.
- Dynamic scene manipulation – add, remove, and move objects.
- Multiple object types – mirrors and circles with different materials.
- Customizable light sources – place and move light sources freely.
- User-friendly controls – tweak ray density, reflections, and length.
- Open
index.html
in your browser. - Adjust ray settings using the control panel.
- Add new objects (mirrors or circles) and change their material properties.
- Click and drag objects to reposition them.
- Observe how light interacts with different surfaces.
- HTML5 Canvas
- JavaScript (ES6+)
- CSS3 (for UI styling)
- Additional object types (prisms, lenses)
- Light absorption and scattering effects
- More advanced material properties
No installation required! Just clone the repository and open index.html
in your browser.
git clone https://github.com/yourusername/Ray-Tracing-Simulator.git
cd Ray-Tracing-Simulator
Then open index.html
.
- Left Click & Drag – Move objects or light sources.
- Right Click – Delete selected object.
- Input Fields & Sliders – Adjust ray count, reflection limits, and other parameters.
If you'd like to contribute to this project, please fork the repository and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.