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…

When it came to teaching myself the fundamentals of the HTML5 canvas, however, it became a bit more of a meaningful experiment owing to the comparatively limited performance of Javascript in most browsers.

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:

http://matthewlynch.net/projects/rayjs/

Source code is unobscured and commented to a reasonable degree.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *