<Back> 23/06/2025

Lasers Program

Social media links: GitHub, Youtube

This is a program that simulates individual rays of light that reflect and refract off of objects in the scene. It uses my graphics and GUI library, however I have not utilised much of GUI aspect. I am planning on implementing menus for adding objects to the scene and changing their properties, but have not got round to doing this yet. So at the moment, there are 4 objects in the scene which can be randomly changed.

I got my inspiration for this project from some youtube video, and thought it would be a interesting project to work on. Another main reason I worked on this was to help visualise lenses and image casting, but so far I have not managed to implement a lens object. Originally it used a bitmap to cast the rays, but I replaced this with a geometric implementation as it allowed for more accuracy and finer detail, and I found that the performance cost was not that much.
There is a demo video on youtube of an older version.

The control scheme:
Esc - Close program; C - Reset view; R - Regenerate random objects; B - Add or remove bounds; S - Make laser automatically spin; H - Histogram rendering; Space - Laser points to mouse; Middle Mouse - Pan view; Scroll - Zoom; Ctrl Scroll - Change laser length;

Source code

Download binaries: Windows, Linux