瀏覽代碼

Examples: Clean up

Mugen87 6 年之前
父節點
當前提交
cafc255b6e

+ 0 - 1
docs/api/en/materials/SpriteMaterial.html

@@ -18,7 +18,6 @@
 		<div>
 			[example:webgl_sprites WebGL / sprites]<br />
 			[example:misc_ubiquity_test misc / ubiquity / test]<br />
-			[example:misc_ubiquity_test2 misc / ubiquity / test2]<br />
 			[example:software_sandbox software / sandbox]<br />
 			[example:svg_sandbox svg / sandbox]<br />
 			[example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]

+ 0 - 1
docs/api/zh/materials/SpriteMaterial.html

@@ -18,7 +18,6 @@
 		<div>
 			[example:webgl_sprites WebGL / sprites]<br />
 			[example:misc_ubiquity_test misc / ubiquity / test]<br />
-			[example:misc_ubiquity_test2 misc / ubiquity / test2]<br />
 			[example:software_sandbox software / sandbox]<br />
 			[example:svg_sandbox svg / sandbox]<br />
 			[example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]

+ 1 - 2
examples/files.js

@@ -189,7 +189,6 @@ var files = {
 		"webgl_modifier_tessellation",
 		"webgl_morphtargets",
 		"webgl_morphtargets_horse",
-		"webgl_morphtargets_human",
 		"webgl_morphtargets_sphere",
 		"webgl_multiple_canvases_circle",
 		"webgl_multiple_canvases_complex",
@@ -356,7 +355,7 @@ var files = {
 		"misc_fps",
 		"misc_lights_test",
 		"misc_lookat",
-		"misc_ubiquity_test2",
+		"misc_ubiquity_test",
 		"misc_uv_tests"
 	],
 	"css3d": [

+ 0 - 141
examples/js/UCSCharacter.js

@@ -1,141 +0,0 @@
-THREE.UCSCharacter = function () {
-
-	var scope = this;
-
-	var mesh;
-
-	this.scale = 1;
-
-	this.root = new THREE.Object3D();
-
-	this.numSkins = undefined;
-	this.numMorphs = undefined;
-
-	this.skins = [];
-	this.materials = [];
-	this.morphs = [];
-
-	this.mixer = new THREE.AnimationMixer( this.root );
-
-	this.onLoadComplete = function () {};
-
-	this.loadCounter = 0;
-
-	this.loadParts = function ( config ) {
-
-		this.numSkins = config.skins.length;
-		this.numMorphs = config.morphs.length;
-
-		// Character geometry + number of skins
-		this.loadCounter = 1 + config.skins.length;
-
-		// SKINS
-		this.skins = loadTextures( config.baseUrl + "skins/", config.skins );
-		this.materials = createMaterials( this.skins );
-
-		// MORPHS
-		this.morphs = config.morphs;
-
-		// CHARACTER
-		var loader = new THREE.JSONLoader();
-		console.log( config.baseUrl + config.character );
-		loader.load( config.baseUrl + config.character, function ( geometry ) {
-
-			geometry.computeBoundingBox();
-			geometry.computeVertexNormals();
-
-			mesh = new THREE.SkinnedMesh( geometry, [] );
-			mesh.name = config.character;
-			scope.root.add( mesh );
-
-			var bb = geometry.boundingBox;
-			scope.root.scale.set( config.s, config.s, config.s );
-			scope.root.position.set( config.x, config.y - bb.min.y * config.s, config.z );
-
-			mesh.castShadow = true;
-			mesh.receiveShadow = true;
-
-			scope.mixer.clipAction( geometry.animations[ 0 ], mesh ).play();
-
-			scope.setSkin( 0 );
-
-			scope.checkLoadComplete();
-
-		} );
-
-	};
-
-	this.setSkin = function ( index ) {
-
-		if ( mesh && scope.materials ) {
-
-			mesh.material = scope.materials[ index ];
-
-		}
-
-	};
-
-	this.updateMorphs = function ( influences ) {
-
-		if ( mesh ) {
-
-			for ( var i = 0; i < scope.numMorphs; i ++ ) {
-
-				mesh.morphTargetInfluences[ i ] = influences[ scope.morphs[ i ] ] / 100;
-
-			}
-
-		}
-
-	};
-
-	function loadTextures( baseUrl, textureUrls ) {
-
-		var textureLoader = new THREE.TextureLoader();
-		var textures = [];
-
-		for ( var i = 0; i < textureUrls.length; i ++ ) {
-
-			textures[ i ] = textureLoader.load( baseUrl + textureUrls[ i ], scope.checkLoadComplete );
-			textures[ i ].mapping = THREE.UVMapping;
-			textures[ i ].name = textureUrls[ i ];
-
-		}
-
-		return textures;
-
-	}
-
-	function createMaterials( skins ) {
-
-		var materials = [];
-
-		for ( var i = 0; i < skins.length; i ++ ) {
-
-			materials[ i ] = new THREE.MeshLambertMaterial( {
-				color: 0xeeeeee,
-				specular: 10.0,
-				map: skins[ i ],
-				skinning: true,
-				morphTargets: true
-			} );
-
-		}
-
-		return materials;
-
-	}
-
-	this.checkLoadComplete = function () {
-
-		scope.loadCounter -= 1;
-
-		if ( scope.loadCounter === 0 ) {
-
-			scope.onLoadComplete();
-
-		}
-
-	};
-
-};

+ 1 - 4
examples/misc_ubiquity_test2.html → examples/misc_ubiquity_test.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 	<head>
-		<title>three.js misc - ubiquity - test2</title>
+		<title>three.js misc - ubiquity - test</title>
 		<meta charset="utf-8">
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
@@ -15,9 +15,6 @@
 	<body>
 
 		<script src="../build/three.js"></script>
-
-		<script src="js/renderers/Projector.js"></script>
-
 		<script src="js/libs/stats.min.js"></script>
 
 		<div id='container1' style='float: left '></div>

二進制
examples/models/skinned/UCS/skins/Asian_Male.jpg


二進制
examples/models/skinned/UCS/skins/Black_Female.jpg


二進制
examples/models/skinned/UCS/skins/Caucasion_Female.jpg


二進制
examples/models/skinned/UCS/skins/Caucasion_Male.jpg


二進制
examples/models/skinned/UCS/skins/Highlighted_Muscles.jpg


二進制
examples/models/skinned/UCS/skins/Indian_Male.jpg


文件差異過大導致無法顯示
+ 0 - 29
examples/models/skinned/UCS/umich_ucs.js


+ 0 - 10
examples/models/skinned/UCS_config.json

@@ -1,10 +0,0 @@
-{
-	"baseUrl":		"models/skinned/UCS/",
-	"character":	"umich_ucs.js",
-	"skins": 		["Asian_Male.jpg", "Black_Female.jpg", "Caucasion_Female.jpg", "Caucasion_Male.jpg", "Highlighted_Muscles.jpg", "Indian_Male.jpg"],
-	"morphs": 		["Obesity", "Femininity", "Musculature", "Age", "Skinniness"],
-	"x":	0,
-	"y":	-500,
-	"z":	-300,
-	"s":	30
-}

+ 0 - 234
examples/webgl_morphtargets_human.html

@@ -1,234 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-	<head>
-		<title>three.js webgl - morph target - human</title>
-		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
-		<style>
-			body {
-				color: #000;
-				font-family:Monospace;
-				font-size:13px;
-				text-align:center;
-
-				background-color: #fff;
-				margin: 0px;
-				overflow: hidden;
-			}
-
-			#info {
-				position: absolute;
-				top: 0px; width: 100%;
-				padding: 5px;
-			}
-
-			a {
-				color: #0af;
-			}
-		</style>
-	</head>
-
-	<body>
-
-		<div id="container"></div>
-
-		<div id="info">
-		<a href="http://github.com/mrdoob/three.js" target="_blank" rel="noopener">three.js</a> webgl - morph targets - human
-		</div>
-
-		<script src="../build/three.js"></script>
-
-		<script src="js/UCSCharacter.js"></script>
-
-		<script src="js/WebGL.js"></script>
-
-		<script src='js/libs/dat.gui.min.js'></script>
-
-		<script src="js/controls/OrbitControls.js"></script>
-
-		<script>
-
-			var SCREEN_WIDTH = window.innerWidth;
-			var SCREEN_HEIGHT = window.innerHeight;
-
-			var container;
-
-			var camera, scene, renderer;
-			var character, controls;
-
-			var clock = new THREE.Clock();
-
-			var gui, skinConfig, morphConfig;
-
-			init();
-			animate();
-
-			function init() {
-
-				container = document.getElementById( 'container' );
-
-				camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 100000 );
-				camera.position.set( 2000, 5000, 5000 );
-
-				scene = new THREE.Scene();
-				scene.background = new THREE.Color( 0xffffff );
-
-				// LIGHTS
-
-				var light = new THREE.DirectionalLight( 0xffffff, 1 );
-				light.position.set( 0, 140, 500 );
-				light.position.multiplyScalar( 1.1 );
-				light.color.setHSL( 0.6, 0.075, 1 );
-				scene.add( light );
-
-				//
-
-				var light = new THREE.DirectionalLight( 0xffffff, 1 );
-				light.position.set( 0, - 1, 0 );
-				scene.add( light );
-
-				// RENDERER
-
-				renderer = new THREE.WebGLRenderer( { antialias: true } );
-				renderer.setPixelRatio( window.devicePixelRatio );
-				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
-				container.appendChild( renderer.domElement );
-
-				// CHARACTER
-
-				character = new THREE.UCSCharacter();
-				character.onLoadComplete = function () {
-
-					console.log( "Load Complete" );
-					console.log( character.numSkins + " skins and " + character.numMorphs + " morphtargets loaded." );
-					gui = new dat.GUI();
-					setupSkinsGUI();
-					setupMorphsGUI();
-					gui.width = 300;
-					gui.open();
-
-				};
-
-				var loader = new THREE.FileLoader();
-				loader.load( 'models/skinned/UCS_config.json', function ( text ) {
-
-					var config = JSON.parse( text );
-					character.loadParts( config );
-					scene.add( character.root );
-
-				} );
-
-				window.addEventListener( 'resize', onWindowResize, false );
-
-				controls = new THREE.OrbitControls( camera, renderer.domElement );
-				controls.target.set( 0, 3000, 0 );
-				controls.update();
-
-				controls.addEventListener( 'change', render );
-
-			}
-
-			function setupSkinsGUI() {
-
-				var skinGui = gui.addFolder( "Skins" );
-
-				skinConfig = {
-					wireframe: false
-				};
-
-				var skinCallback = function ( index ) {
-
-					return function () {
-
-						character.setSkin( index );
-
-					};
-
-				};
-
-				for ( var i = 0; i < character.numSkins; i ++ ) {
-
-					var name = character.skins[ i ].name;
-					skinConfig[ name ] = skinCallback( i );
-
-				}
-
-				for ( var i = 0; i < character.numSkins; i ++ ) {
-
-					skinGui.add( skinConfig, character.skins[ i ].name );
-
-				}
-
-				skinGui.open();
-
-			}
-
-			function setupMorphsGUI() {
-
-				var morphGui = gui.addFolder( "Morphs" );
-
-				morphConfig = {
-				};
-
-				var morphCallback = function () {
-
-					return function () {
-
-						character.updateMorphs( morphConfig );
-
-					};
-
-				};
-
-				for ( var i = 0; i < character.numMorphs; i ++ ) {
-
-					var morphName = character.morphs[ i ];
-					morphConfig[ morphName ] = 0;
-
-				}
-
-				for ( var i = 0; i < character.numMorphs; i ++ ) {
-
-					morphGui.add( morphConfig, character.morphs[ i ] ).min( 0 ).max( 100 ).onChange( morphCallback( i ) );
-
-				}
-
-				morphGui.open();
-
-			}
-
-			function onWindowResize() {
-
-				camera.aspect = window.innerWidth / window.innerHeight;
-				camera.updateProjectionMatrix();
-
-				renderer.setSize( window.innerWidth, window.innerHeight );
-
-			}
-
-			//
-
-			function animate() {
-
-				requestAnimationFrame( animate );
-
-				render();
-
-			}
-
-			function render() {
-
-				var delta = 0.75 * clock.getDelta();
-
-				// update skinning
-
-				character.mixer.update( delta );
-
-				renderer.render( scene, camera );
-
-			}
-
-		</script>
-
-	</body>
-</html>

部分文件因文件數量過多而無法顯示