<commit_before>(Very early stage) javascript 3D engine which can use &lt;canvas&gt; and/org &lt;svg&gt; as renderer.

### Examples

[![random.png](http://github.com/mrdoob/three.js/raw/master/examples/particles/random.png)](http://mrdoob.com/lab/javascript/three/particles/random.html)
[![waves.png](http://github.com/mrdoob/three.js/raw/master/examples/particles/waves.png)](http://mrdoob.com/lab/javascript/three/particles/waves.html)
[![floor.png](http://github.com/mrdoob/three.js/raw/master/examples/particles/floor.png)](http://mrdoob.com/lab/javascript/three/particles/floor.html)

### How to use

	var container;
	var camera, scene, renderer;

	init();
	setInterval(loop, 1000 / 60);

	function init()
	{
		camera = new Camera(0, 0, 1000);

		scene = new Scene();
	
		renderer = new CanvasRenderer();
		renderer.setSize(window.innerWidth, window.innerHeight);

		for (var i = 0; i < 1000; i++)
		{
			var particle = new Particle( new ColorMaterial(Math.random() * 0x808008 + 0x808080, 1) );
			particle.size = Math.random() * 10 + 5;
			particle.position.x = Math.random() * 2000 - 1000;
			particle.position.y = Math.random() * 2000 - 1000;
			particle.position.z = Math.random() * 2000 - 1000;
			particle.updateMatrix();
			scene.add( particle );
		}

		container = document.createElement('div');
		document.body.appendChild(container);

		container.appendChild(renderer.viewport);
	}

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

2010 04 24 - **r001**

* First alpha release
<commit_msg>Simplified example code<commit_after>(Very early stage) javascript 3D engine which can use &lt;canvas&gt; and/org &lt;svg&gt; as renderer.

### Examples

[![random.png](http://github.com/mrdoob/three.js/raw/master/examples/particles/random.png)](http://mrdoob.com/lab/javascript/three/particles/random.html)
[![waves.png](http://github.com/mrdoob/three.js/raw/master/examples/particles/waves.png)](http://mrdoob.com/lab/javascript/three/particles/waves.html)
[![floor.png](http://github.com/mrdoob/three.js/raw/master/examples/particles/floor.png)](http://mrdoob.com/lab/javascript/three/particles/floor.html)

### How to use

	var camera, scene, renderer;

	init();
	setInterval(loop, 1000 / 60);

	function init()
	{
		camera = new Camera(0, 0, 1000);

		scene = new Scene();
	
		renderer = new CanvasRenderer();
		renderer.setSize(window.innerWidth, window.innerHeight);

		for (var i = 0; i < 1000; i++)
		{
			var particle = new Particle( new ColorMaterial(Math.random() * 0x808008 + 0x808080, 1) );
			particle.size = Math.random() * 10 + 5;
			particle.position.x = Math.random() * 2000 - 1000;
			particle.position.y = Math.random() * 2000 - 1000;
			particle.position.z = Math.random() * 2000 - 1000;
			particle.updateMatrix();
			scene.add( particle );
		}

		document.body.appendChild(renderer.viewport);
	}

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

2010 04 24 - **r001**

* First alpha release

{'fraction_non_alphanumeric': 0.16902356902356902, 'fraction_numerical': 0.04781144781144781, 'mean_word_length': 4.0613287904599655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2026296', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1011, 'n_words': 193}