RayJS – Practical Trigonometry???
Whenever I start exploring new development platforms—new to me at least—I quite often set myself the task of creating a ray casting demo. It might not be the most practical, nor impressive approach in this day and age, but it is the method I have used since I was but a wee lad, and so nostalgia…
As an aside, I am also quite fond of ray casting demos as a practical use for trigonometry. If my school teachers has shown me how SOHCAHTOA could be used to bring a (psuedo)3D world to life, I might have had better grades from the get go.
But anyway, it might struggle in some browsers, and might fail to run completely in others… but if you have a relatively modern and standards compliant browsers like stable Chrome, you can check out my HTML5 canvas ray casting demo right here:
Source code is unobscured and commented to a reasonable degree.