raytracer
v1.0.4
Published
ray tracer canvas
Downloads
2
Readme
Ray Tracer
a simple ray tracer engine
Example
Introduction
rayTracer is a lightweight ray tracer render engine base on canvas 2d api.
Feature
Include light
object3d
camera
scene
renderer
reflect
and so on.
rayTracer`s api is very like threejs, you can ease to code your stage by following:
const renderer = new JC.Renderer({
canvas: document.querySelector('#canvas_screen'),
});
const scene = new JC.Scene();
const camera = new JC.Camera(new JC.Vector3(0, 5, 15), 90, new JC.Vector3(0, 0, -1), new JC.Vector3(0, 1, 0));
const plane = new JC.Plane(new JC.Vector3(0, 1, 0), 0);
plane.material = new JC.CheckerMaterial(0.1, 0.5);
scene.adds(plane);
renderer.render(scene, camera);