mjsr
is a simple, lightweight 3d library for JavaScript.
Using a CDN:
<script src="https://cdn.jsdelivr.net/gh/caterpyowo/mjsr@v1.0.0/dist/mjsr.min.js"></script>
Using a local copy (See the releases tab to find the latest version).
<script src="./mjsr.min.js"></script>
const r = new mjsr.Renderer(
new mjsr.Screen().fullscreen(),
new mjsr.Camera([0, 0, -7]),
new mjsr.Input.FirstPerson()
);
let scene = [new mjsr.Geometry.Cube([0, 0, 0])];
r.setup(scene);
function frame(now) {
requestAnimationFrame(frame);
r.draw();
r.update(now);
}
requestAnimationFrame(frame);
Visit the wiki for documentation.
More examples of usage: