Three.js 3D rendering library for javascript #gamedev #game-engine #rendering #javascript

Mr.doob a97ce787f1 New README and some examples 15 年之前
build 094310793e License and build 15 年之前
examples a97ce787f1 New README and some examples 15 年之前
src a90c4e107f First public version. Still a lot to do 15 年之前
LICENSE 094310793e License and build 15 年之前
README.md a97ce787f1 New README and some examples 15 年之前

README.md

Basic and modular javascript 3d engine.

Can use and/org as renderer.

How to use

var SCREEN_WIDTH = window.innerWidth;
var SCREEN_HEIGHT = window.innerHeight;

var camera = new Camera(0, 0, 1000);

var scene = new Scene();

var renderer = new CanvasRenderer();
renderer.setSize(SCREEN_WIDTH, SCREEN_HEIGHT);

var material = new ColorMaterial(0xffffff, 1);

for (var i = 0; i < 1000; i++)
{
    var particle = new Particle( material );
    particle.position.x = Math.random() * 1000 - 500;
    particle.position.y = Math.random() * 1000 - 500;
    particle.position.z = Math.random() * 1000 - 500;
    particle.updateMatrix();
    scene.add( particle );
}

dom_element.appendChild(renderer.viewport);

setInterval(loop, 1000 / 60);

function loop()
{
    renderer.render(scene, camera);
}

Examples

waves.png floor.png

Change Log

2010 04 24 - r011.2

  • First alpha release