вот мой код...
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 20000000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
renderer.shadowMapEnabled = true;
renderer.setClearColorHex( 0x00000, 1 );
function gen_stars(){
var particleCount = 1000;
var particles = new THREE.Geometry();
var pMaterial = new THREE.ParticleBasicMaterial( { color: 0xffffff, size: 1} );
for ( p = 0; p < particleCount; p++ ) {
pX = Math.random() * 1000000 - 500000;
pY = Math.random() * 1000000 - 500000;
pZ = Math.random() * 1000000 - 500000;
var particle = new THREE.Vertex( new THREE.Vector3( pX, pY, pZ ) );
particles.vertices.push( particle );
}
particles.verticesNeedUpdate = true;
var particleSystem = new THREE.ParticleSystem( particles, pMaterial );
scene.add( particleSystem );
}
gen_stars();
var light = new THREE.PointLight( 0xffffff, 1, 100 );
light.position.set( 0, 0, 0 );
scene.add( light );
var render = function () {
particles.vertices[0].position.x++;
light.position.set( camera.position.x, camera.position.y, camera.position.z );
requestAnimationFrame( render );
renderer.render( scene, camera );
};
render();