Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- loader.load(
- "objects/brain-simple-mesh.json",
- function ( obj ) {
- obj.traverse((node) => {
- if (node.material) {
- node.material.opacity = 0.5;
- node.material.alphaTest = 0.5;
- node.material.transparent = true;
- }
- });
- window.group = new THREE.Object3D();
- //reajustments
- obj.rotation.z = -0.5;
- obj.rotation.x = 0.09;
- group.add(window.obj=obj);
- scene.add( group );
- //look at object
- camera.position.z = 10;
- setInterval(function(){
- //rotate object
- window.group.rotation.y+=0.03;
- }, 100);
- },
- function ( xhr ) {
- //progress bar
- document.getElementById('loader').style.display = 'none';
- document.getElementById('progress').style.width = (xhr.loaded / ( xhr.total > 0 ? xhr.total : 9719635 ) * 100) + '%';
- },
- function ( err ) {
- //error
- console.error( 'An error happened' );
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement