Skip to content

mohebifar/lithree.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version npm

lithree.js

lithree.js is a lightweight 3D WebGL framework. It's just about 25kb. lithree.js is originally written in ES6 and is transcompiled to ES5.

When to use lithree.js

LiThree is created for lightweight 3D projects. For example if you want to create a website to preview some simple product, It's not proper to load some heavy library like three.js which is about 450kb when minified.

Usage

You can check the demo here.

Make a world which will contain all your elements.

var world = new LiThree.World();

Create an object using object factories.

var sphere = LiThree.ObjectFactory.Sphere(1, 20, 20);

Add object to the world.

world.add(sphere);

Create a renderer.

var renderer = new LiThree.WebGLRenderer(640, 480, world);
renderer.initShapes();

Append canvas to body.

document.body.appendChild(renderer.canvas);

Attempt to draw and redraw canvas as many times as you want.

function redraw() {
    renderer.draw();
    requestAnimationFrame(redraw);
}

requestAnimationFrame(redraw);

Contribution

Feel free to help us and making a new awesome 3D library with ES6.

About

🔮 Lightweight 3D WebGL framework written in ES6

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published