Skip to content

ThatSINEWAVE/Ray-Tracing-Simulator

Repository files navigation

Ray-Tracing-Simulator

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.

🌟 Features

  • 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.

🎮 How to Use

  1. Open index.html in your browser.
  2. Adjust ray settings using the control panel.
  3. Add new objects (mirrors or circles) and change their material properties.
  4. Click and drag objects to reposition them.
  5. Observe how light interacts with different surfaces.

📌 Technologies Used

  • HTML5 Canvas
  • JavaScript (ES6+)
  • CSS3 (for UI styling)

🚀 Future Improvements

  • Additional object types (prisms, lenses)
  • Light absorption and scattering effects
  • More advanced material properties

🛠️ Setup & Installation

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.

📜 Controls

  • Left Click & Drag – Move objects or light sources.
  • Right Click – Delete selected object.
  • Input Fields & Sliders – Adjust ray count, reflection limits, and other parameters.

Contributing

If you'd like to contribute to this project, please fork the repository and create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.