»
EnglishFrenchVietnamese

Print - 3D JavaScript Ray Tracer - JavaScriptBank.com

Full version: jsB@nk » 3D » 3D JavaScript Ray Tracer
URL: https://www.javascriptbank.com/3d-javascript-ray-tracer.html

3D JavaScript Ray Tracer © JavaScriptBank.comThis a ray tracer in JavaScript. The code is pretty close to a direct translation of the raytracer I did for my computer graphics class, which you can find here (code under "handed_in/"). It's not really complete (spheres only, no reflections), and has some bugs, a raytracer. It's buggy and incomplete, but works well enough to render spheres.

Full version: jsB@nk » 3D » 3D JavaScript Ray Tracer
URL: https://www.javascriptbank.com/3d-javascript-ray-tracer.html



JavaScript
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]--><script src="point.js"></script><script src="light.js"></script><script src="material.js"></script><script src="sphere.js"></script><script src="raytracer.js"></script>


HTML
<p><canvas id="theCanvas" width="300" height="150"></canvas></p>      <p><input type="button" onclick="drawScene();" value="Render"/> <input type="button" onclick="isKilled = true;" value="Stop Render"/><br/>      Progress: <input type="text" id="statusText" size="15"/></p>