Собственно код
function init(container,path) {
camera = new THREE.PerspectiveCamera( 20, window.innerWidth / window.innerHeight, 0.2, 2000 );
camera.position.z = 1100;
scene = new THREE.Scene();
var ambient = new THREE.AmbientLight( 0xffffff );
scene.add( ambient );
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.1);
directionalLight.position.set( 0, 0, 1 );
scene.add( directionalLight );
var texture = THREE.ImageUtils.loadTexture('/public/texture.png');
// texture.wrapS = THREE.RepeatWrapping;
// texture.wrapT = THREE.RepeatWrapping;
var sphereMaterial = new THREE.MeshLambertMaterial({
map: texture
});
var loader = new THREE.OBJLoader();
loader.load(path, function(object) {
window.z = object;
object.children[0].material = sphereMaterial;
scene.add( object );
animate();
});
renderer = new THREE.WebGLRenderer();
renderer.setSize( 800, 600 );
container.appendChild( renderer.domElement );
}
function animate() {
requestAnimationFrame( animate );
render();
}
function render() {
renderer.render( scene, camera );
}
И то, что он отрисовывает