Browse Source

Merge remote-tracking branch 'remotes/mrdoob/dev' into dev

alteredq 13 years ago
parent
commit
d59a9a31e9

+ 3 - 1
docs/api/core/Face4.html

@@ -16,7 +16,9 @@
 
 		<h2>Example</h2>
 
-		<code>var face = new THREE.Face4( 0, 1, 2, 3, new THREE.Vector3( 0, 1, 0 ), new THREE.Color( 0xffaa00 ), 0 );</code>
+		<code>var normal = new THREE.Vector3( 0, 1, 0 );
+		var color = new THREE.Color( 0xffaa00 );
+		var face = new THREE.Face4( 0, 1, 2, 3, normal, color, 0 );</code>
 
 
 		<h2>Constructor</h2>

+ 1 - 1
docs/api/core/Vector3.html

@@ -177,7 +177,7 @@
 
 		<h3>.isZero() [page:Boolean]</h3>
 		<div>
-		Checks if length of this vector is within small epsilon (*0.0001*).
+		Checks if length of this vector is within small epsilon (*0.01*).
 		</div>
 
 		<h3>.clone() [page:Vector3]</h3>

+ 8 - 15
docs/prettify/threejs.css

@@ -1,22 +1,15 @@
-pre .str, code .str { color: #ad934c; } /* string */
-pre .kwd, code .kwd { color: #ffffa0; } /* keyword */
-pre .com, code .com { color: #709070; } /* comment */
-pre .typ, code .typ { color: #f09041; } /* type */
-pre .lit, code .lit { color: #22c0c4; } /* literal */
-pre .pun, code .pun { color: #cccccc; } /* punctuation */
-pre .pln, code .pln { color: #cccccc; } /* plaintext */
+pre .str, code .str { color: #8000ff; } /* string */
+pre .kwd, code .kwd { color: #30b030; } /* keyword */
+pre .com, code .com { color: #999999; } /* comment */
+pre .typ, code .typ { color: #2194ce; } /* type */
+pre .lit, code .lit { color: #ff0080; } /* literal */
+pre .pun, code .pun { color: #888888; } /* punctuation */
+pre .pln, code .pln { color: #444444; } /* plaintext */
 pre .dec, code .dec { color: #22c0c4; } /* decimal */
 
 
 
 pre.prettyprint, code.prettyprint {
-	background-color: #211e1e;
+	background-color: #f9f9f9;
 	font-family: 'inconsolata';
-	box-shadow: 0 0 0.5em #666;
-	-moz-border-radius: 3px;
-	-webkit-border-radius: 3px;
-	-o-border-radius: 3px;
-	-ms-border-radius: 3px;
-	-khtml-border-radius: 3px;
-	border-radius: 3px;
 }

+ 468 - 472
examples/scenes/test_scene.js

@@ -1,524 +1,520 @@
 {
 
-"metadata":
-{
-	"formatVersion": 3,
-	"type"		   : "scene"
-},
-
-"urlBaseType" : "relativeToHTML",
-
-"objects":
-{
-	"cube1" : {
-		"geometry" : "cubeNormals",
-		"materials": [ "lambert_red" ],
-		"position" : [ 0, 0, 0 ],
-		"rotation" : [ 0, -0.3, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
+	"metadata": {
+		"formatVersion": 3,
+		"type" : "scene"
 	},
 
-	"cube2" : {
-		"geometry" : "cubeWire",
-		"materials": [ "basic_white" ],
-		"position" : [ 0, 0, 0 ],
-		"rotation" : [ 0, -0.3, 0 ],
-		"scale"	   : [ 2, 2, 2 ],
-		"visible"  : true
-	},
-
-	"cube3" : {
-		"geometry" : "cube",
-		"materials": [ "minecraft" ],
-		"position" : [ -30, -5, 25 ],
-		"rotation" : [ 0, 0.8, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
+	"urlBaseType" : "relativeToHTML",
 
-	"sphere_lambert" : {
-		"geometry" : "sphere",
-		"materials": [ "lambert_green" ],
-		"position" : [ -20, -5, 15 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"sphere_refraction" : {
-		"geometry" : "sphere",
-		"materials": [ "basic_refraction" ],
-		"position" : [ 50, 45, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"icosahedron" : {
-		"geometry" : "icosahedron",
-		"materials": [ "faceted_white" ],
-		"position" : [ 20, 10, -60 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-
-	"torus" : {
-		"geometry" : "torus",
-		"materials": [ "phong_orange" ],
-		"position" : [ -20, 5, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 2, 2, 2 ],
-		"visible"  : true
-	},
+	"objects": {
 
-	"cone" : {
-		"geometry" : "cone",
-		"materials": [ "lambert_blue" ],
-		"position" : [ -50, 15, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"cylinder" : {
-		"geometry" : "cylinder",
-		"materials": [ "lambert_blue" ],
-		"position" : [ 50, 15, -50 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 1, 1, 1 ],
-		"visible"  : true
-	},
-
-	"colorcube1" : {
-		"geometry" : "colorcube",
-		"materials": [],
-		"position" : [ -10, -5, 30 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 5, 5, 5 ],
-		"visible"  : true,
-		"children" : {
-			"colorcube2" : {
-				"geometry" : "colorcube",
-				"materials": [],
-				"position" : [ 0, 2, 0 ],
-				"rotation" : [ 0.1, 0.1, 0.1 ],
-				"scale"    : [ 0.5, 0.5, 0.5 ],
-				"visible"  : true,
-				"children" : {
-					"colorcube3" : {
-						"geometry" : "colorcube",
-						"materials": [],
-						"position" : [ 0, 2, 0 ],
-						"rotation" : [ 0.1, 0.1, 0.1 ],
-						"scale"    : [ 0.5, 0.5, 0.5 ],
-						"visible"  : true,
-						"children" : {
-							"colorcube4" : {
-								"geometry" : "colorcube",
-								"materials": [],
-								"position" : [ 0, 2, 0 ],
-								"rotation" : [ 0.1, 0.1, 0.1 ],
-								"scale"    : [ 0.5, 0.5, 0.5 ],
-								"visible"  : true
+		"cube1" : {
+			"geometry" : "cubeNormals",
+			"materials": [ "lambert_red" ],
+			"position" : [ 0, 0, 0 ],
+			"rotation" : [ 0, -0.3, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true,
+			"properties" : {
+				"rotating" : true
+			}
+		},
+
+		"cube2" : {
+			"geometry" : "cubeWire",
+			"materials": [ "basic_white" ],
+			"position" : [ 0, 0, 0 ],
+			"rotation" : [ 0, -0.3, 0 ],
+			"scale"	   : [ 2, 2, 2 ],
+			"visible"  : true
+		},
+
+		"cube3" : {
+			"geometry" : "cube",
+			"materials": [ "minecraft" ],
+			"position" : [ -30, -5, 25 ],
+			"rotation" : [ 0, 0.8, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"sphere_lambert" : {
+			"geometry" : "sphere",
+			"materials": [ "lambert_green" ],
+			"position" : [ -20, -5, 15 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"sphere_refraction" : {
+			"geometry" : "sphere",
+			"materials": [ "basic_refraction" ],
+			"position" : [ 50, 45, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"icosahedron" : {
+			"geometry" : "icosahedron",
+			"materials": [ "faceted_white" ],
+			"position" : [ 20, 10, -60 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+
+		"torus" : {
+			"geometry" : "torus",
+			"materials": [ "phong_orange" ],
+			"position" : [ -20, 5, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 2, 2, 2 ],
+			"visible"  : true
+		},
+
+		"cone" : {
+			"geometry" : "cone",
+			"materials": [ "lambert_blue" ],
+			"position" : [ -50, 15, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"cylinder" : {
+			"geometry" : "cylinder",
+			"materials": [ "lambert_blue" ],
+			"position" : [ 50, 15, -50 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 1, 1, 1 ],
+			"visible"  : true
+		},
+
+		"colorcube1" : {
+			"geometry" : "colorcube",
+			"materials": [],
+			"position" : [ -10, -5, 30 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 5, 5, 5 ],
+			"visible"  : true,
+			"children" : {
+				"colorcube2" : {
+					"geometry" : "colorcube",
+					"materials": [],
+					"position" : [ 0, 2, 0 ],
+					"rotation" : [ 0.1, 0.1, 0.1 ],
+					"scale"    : [ 0.5, 0.5, 0.5 ],
+					"visible"  : true,
+					"children" : {
+						"colorcube3" : {
+							"geometry" : "colorcube",
+							"materials": [],
+							"position" : [ 0, 2, 0 ],
+							"rotation" : [ 0.1, 0.1, 0.1 ],
+							"scale"    : [ 0.5, 0.5, 0.5 ],
+							"visible"  : true,
+							"children" : {
+								"colorcube4" : {
+									"geometry" : "colorcube",
+									"materials": [],
+									"position" : [ 0, 2, 0 ],
+									"rotation" : [ 0.1, 0.1, 0.1 ],
+									"scale"    : [ 0.5, 0.5, 0.5 ],
+									"visible"  : true
+								}
 							}
 						}
 					}
 				}
 			}
+		},
+
+		"veyron" : {
+			"geometry" : "veyron",
+			"materials": [ "face" ],
+			"position" : [ 40, -1, 0 ],
+			"rotation" : [ 0, 0.3, 0 ],
+			"scale"	   : [ 0.25, 0.25, 0.25 ],
+			"visible"  : true
+		},
+
+		"walt" : {
+			"geometry" : "WaltHead",
+			"materials": [ "lambert_cube" ],
+			"position" : [ -45, 10, 0 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 0.5, 0.5, 0.5 ],
+			"visible"  : true
+		},
+
+		"quad_bg" : {
+			"geometry" : "quad",
+			"materials": [ "textured_bg" ],
+			"position" : [ 0, 15, -90 ],
+			"rotation" : [ 0, 0, 0 ],
+			"scale"	   : [ 20, 20, 20 ],
+			"visible"  : true
+		},
+
+		"ground" : {
+			"geometry" : "plane",
+			"materials": [ "basic_gray" ],
+			"position" : [ 0, -10, 0 ],
+			"rotation" : [ -1.57, 0, 0 ],
+			"scale"	   : [ 100, 100, 100 ],
+			"visible"  : true
 		}
-	},
-
-	"veyron" : {
-		"geometry" : "veyron",
-		"materials": [ "face" ],
-		"position" : [ 40, -1, 0 ],
-		"rotation" : [ 0, 0.3, 0 ],
-		"scale"	   : [ 0.25, 0.25, 0.25 ],
-		"visible"  : true
-	},
-
-	"walt" : {
-		"geometry" : "WaltHead",
-		"materials": [ "lambert_cube" ],
-		"position" : [ -45, 10, 0 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 0.5, 0.5, 0.5 ],
-		"visible"  : true
-	},
-
-	"quad_bg" : {
-		"geometry" : "quad",
-		"materials": [ "textured_bg" ],
-		"position" : [ 0, 15, -90 ],
-		"rotation" : [ 0, 0, 0 ],
-		"scale"	   : [ 20, 20, 20 ],
-		"visible"  : true
-	},
-
-	"ground" : {
-		"geometry" : "plane",
-		"materials": [ "basic_gray" ],
-		"position" : [ 0, -10, 0 ],
-		"rotation" : [ -1.57, 0, 0 ],
-		"scale"	   : [ 100, 100, 100 ],
-		"visible"  : true
-	}
-
-},
-
-"geometries":
-{
-	"cube": {
-		"type"  : "cube",
-		"width" : 10,
-		"height": 10,
-		"depth" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1,
-		"segmentsDepth"  : 1,
-		"flipped" : false,
-		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
-	},
-
-	"cubeNormals": {
-		"type"  : "cube",
-		"width" : 10,
-		"height": 10,
-		"depth" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1,
-		"segmentsDepth"  : 1,
-		"flipped" : false,
-		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
-	},
-
-	"cubeWire": {
-		"type"  : "cube",
-		"width" : 10,
-		"height": 10,
-		"depth" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1,
-		"segmentsDepth"  : 1,
-		"flipped" : false,
-		"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
-	},
-
-	"plane": {
-		"type"   : "plane",
-		"width"  : 10,
-		"height" : 10,
-		"segmentsWidth"  : 50,
-		"segmentsHeight" : 50
-	},
-
-	"quad": {
-		"type"   : "plane",
-		"width"  : 10,
-		"height" : 10,
-		"segmentsWidth"  : 1,
-		"segmentsHeight" : 1
-	},
-
-	"sphere": {
-		"type"    : "sphere",
-		"radius"  : 5,
-		"segmentsWidth"  : 32,
-		"segmentsHeight" : 16
-	},
-
-	"icosahedron": {
-		"type"    : "icosahedron",
-		"radius"  : 20,
-		"subdivisions"  : 2
-	},
-
-	"torus": {
-		"type"    : "torus",
-		"radius"  : 5,
-		"tube"	  : 2,
-		"segmentsR" : 16,
-		"segmentsT" : 32
-	},
-
-	"cylinder": {
-		"type"    : "cylinder",
-		"topRad"   : 5,
-		"botRad"   : 5,
-		"height"   : 50,
-		"radSegs"  : 32,
-		"heightSegs": 1
-	},
-
-	"cone": {
-		"type"    : "cylinder",
-		"topRad"   : 0,
-		"botRad"   : 5,
-		"height"   : 50,
-		"radSegs"  : 32,
-		"heightSegs" : 1
-	},
-
-	"WaltHead": {
-		"type": "bin_mesh",
-		"url" : "obj/walt/WaltHead_bin.js"
-	},
-
-	"veyron": {
-		"type": "bin_mesh",
-		"url" : "obj/veyron/VeyronNoUv_bin.js"
-	},
-
-	"colorcube": {
-		"type": "embedded_mesh",
-		"id"  : "cube_fvc"
-	}
 
-},
-
-"embeds": {
-
-	"cube_fvc": {
-
-    "metadata" : { "formatVersion" : 3 },
-
-    "scale" : 1.0,
-
-    "materials": [	{
-	"DbgColor" : 15658734,
-	"DbgIndex" : 0,
-	"DbgName" : "Material",
-	"colorAmbient" : [0.0, 0.0, 0.0],
-	"colorDiffuse" : [0.8, 0.8, 0.8],
-	"colorSpecular" : [0.5, 0.5, 0.5],
-	"specularCoef" : 50,
-	"transparency" : 1.0,
-	"vertexColors" : true
-	}],
-
-    "vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
-
-    "morphTargets": [],
-
-    "normals": [],
-
-    "colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
-
-    "uvs": [[]],
-
-    "faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21],
-
-    "edges" : []
-
-	}
-
-},
-
-"materials":
-{
-
-	"basic_gray": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 6710886, "wireframe": true }
 	},
 
-	"basic_white": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "wireframe": true }
-	},
+	"geometries": {
+
+		"cube": {
+			"type"  : "cube",
+			"width" : 10,
+			"height": 10,
+			"depth" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1,
+			"segmentsDepth"  : 1,
+			"flipped" : false,
+			"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+		},
+
+		"cubeNormals": {
+			"type"  : "cube",
+			"width" : 10,
+			"height": 10,
+			"depth" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1,
+			"segmentsDepth"  : 1,
+			"flipped" : false,
+			"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+		},
+
+		"cubeWire": {
+			"type"  : "cube",
+			"width" : 10,
+			"height": 10,
+			"depth" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1,
+			"segmentsDepth"  : 1,
+			"flipped" : false,
+			"sides"   : { "px": true, "nx": true, "py": true, "ny": true, "pz": true, "nz": true }
+		},
+
+		"plane": {
+			"type"   : "plane",
+			"width"  : 10,
+			"height" : 10,
+			"segmentsWidth"  : 50,
+			"segmentsHeight" : 50
+		},
+
+		"quad": {
+			"type"   : "plane",
+			"width"  : 10,
+			"height" : 10,
+			"segmentsWidth"  : 1,
+			"segmentsHeight" : 1
+		},
+
+		"sphere": {
+			"type"    : "sphere",
+			"radius"  : 5,
+			"segmentsWidth"  : 32,
+			"segmentsHeight" : 16
+		},
+
+		"icosahedron": {
+			"type"    : "icosahedron",
+			"radius"  : 20,
+			"subdivisions"  : 2
+		},
+
+		"torus": {
+			"type"    : "torus",
+			"radius"  : 5,
+			"tube"	  : 2,
+			"segmentsR" : 16,
+			"segmentsT" : 32
+		},
+
+		"cylinder": {
+			"type"    : "cylinder",
+			"topRad"   : 5,
+			"botRad"   : 5,
+			"height"   : 50,
+			"radSegs"  : 32,
+			"heightSegs": 1
+		},
+
+		"cone": {
+			"type"    : "cylinder",
+			"topRad"   : 0,
+			"botRad"   : 5,
+			"height"   : 50,
+			"radSegs"  : 32,
+			"heightSegs" : 1
+		},
+
+		"WaltHead": {
+			"type": "bin_mesh",
+			"url" : "obj/walt/WaltHead_bin.js"
+		},
+
+		"veyron": {
+			"type": "bin_mesh",
+			"url" : "obj/veyron/VeyronNoUv_bin.js"
+		},
+
+		"colorcube": {
+			"type": "embedded_mesh",
+			"id"  : "cube_fvc"
+		}
 
-	"faceted_white": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16777215, "shading": "flat" }
 	},
 
-	"lambert_red": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16711680 }
-	},
+	"embeds": {
 
-	"lambert_green": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 30481, "blending": "AdditiveBlending", "transparent": true }
-	},
+		"cube_fvc": {
 
-	"lambert_blue": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 21930 }
-	},
+			"metadata" : {
+				"formatVersion" : 3
+			},
 
-	"phong_orange": {
-		"type": "MeshPhongMaterial",
-		"parameters": { "color": 0, "specular": 11162880 }
-	},
+			"scale" : 1.0,
 
-	"basic_refraction": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "envMap": "cube_refraction", "refractionRatio": 0.95 }
-	},
+			"materials": [{
+				"DbgColor" : 15658734,
+				"DbgIndex" : 0,
+				"DbgName" : "Material",
+				"colorAmbient" : [0.0, 0.0, 0.0],
+				"colorDiffuse" : [0.8, 0.8, 0.8],
+				"colorSpecular" : [0.5, 0.5, 0.5],
+				"specularCoef" : 50,
+				"transparency" : 1.0,
+				"vertexColors" : true
+			}],
 
-	"lambert_cube": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16737792, "envMap": "cube_reflection", "combine": "MixOperation", "reflectivity": 0.3 }
-	},
+			"vertices": [1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,-1.000000,-1.000000,1.000000,-1.000000,-1.000000,-1.000000,1.000000,1.000000,-1.000000,0.999999,1.000000,1.000001,-1.000000,1.000000,1.000000,-1.000000,1.000000,-1.000000],
 
-	"chrome": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16777215, "envMap": "cube_reflection" }
-	},
+			"morphTargets": [],
 
-	"darkerchrome": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 2236962, "envMap": "cube_reflection" }
-	},
+			"normals": [],
 
-	"glass": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 1052742, "envMap": "cube_reflection", "opacity": 0.25, "transparent": true }
-	},
+			"colors": [16777215,16769421,16769424,8454135,15195931,7299839,16586715,16711687,1056014,6029475,13762484,9044089,7962349,6772991,16774622,4144383,11973887,1966063,1056285,9081232,13696943,5002581],
 
-	"interior": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 328965 }
-	},
-
-	"backlights": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16711680, "opacity": 0.5 }
-	},
+			"uvs": [[]],
 
-	"backsignals": {
-		"type": "MeshLambertMaterial",
-		"parameters": { "color": 16759552, "opacity": 0.5 }
-	},
+			"faces": [131,0,1,2,3,0,0,1,2,3,131,4,7,6,5,0,4,5,6,7,131,0,4,5,1,0,0,8,9,10,131,1,5,6,2,0,0,11,12,13,131,2,6,7,3,0,14,15,16,17,131,4,0,3,7,0,18,19,20,21]
 
-	"textured_bg": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "map": "texture_bg" }
-	},
+		}
 
-	"minecraft": {
-		"type": "MeshBasicMaterial",
-		"parameters": { "color": 16777215, "map": "texture_minecraft" }
 	},
 
-	"face": {
-		"type": "MeshFaceMaterial",
-		"parameters": {}
-	}
-
-},
-
-"textures":
-{
+	"materials": {
+
+		"basic_gray": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 6710886, "wireframe": true }
+		},
+
+		"basic_white": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "wireframe": true }
+		},
+
+		"faceted_white": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16777215, "shading": "flat" }
+		},
+
+		"lambert_red": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16711680 }
+		},
+
+		"lambert_green": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 30481, "blending": "AdditiveBlending", "transparent": true }
+		},
+
+		"lambert_blue": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 21930 }
+		},
+
+		"phong_orange": {
+			"type": "MeshPhongMaterial",
+			"parameters": { "color": 0, "specular": 11162880 }
+		},
+
+		"basic_refraction": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "envMap": "cube_refraction", "refractionRatio": 0.95 }
+		},
+
+		"lambert_cube": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16737792, "envMap": "cube_reflection", "combine": "MixOperation", "reflectivity": 0.3 }
+		},
+
+		"chrome": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16777215, "envMap": "cube_reflection" }
+		},
+
+		"darkerchrome": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 2236962, "envMap": "cube_reflection" }
+		},
+
+		"glass": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 1052742, "envMap": "cube_reflection", "opacity": 0.25, "transparent": true }
+		},
+
+		"interior": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 328965 }
+		},
+
+		"backlights": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16711680, "opacity": 0.5 }
+		},
+
+		"backsignals": {
+			"type": "MeshLambertMaterial",
+			"parameters": { "color": 16759552, "opacity": 0.5 }
+		},
+
+		"textured_bg": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "map": "texture_bg" }
+		},
+
+		"minecraft": {
+			"type": "MeshBasicMaterial",
+			"parameters": { "color": 16777215, "map": "texture_minecraft" }
+		},
+
+		"face": {
+			"type": "MeshFaceMaterial",
+			"parameters": {}
+		}
 
-	"cube_reflection": {
-		"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
-				 "textures/cube/SwedishRoyalCastle/nx.jpg",
-				 "textures/cube/SwedishRoyalCastle/py.jpg",
-				 "textures/cube/SwedishRoyalCastle/ny.jpg",
-				 "textures/cube/SwedishRoyalCastle/pz.jpg",
-				 "textures/cube/SwedishRoyalCastle/nz.jpg"
-				]
 	},
 
-	"cube_refraction": {
-		"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
-				 "textures/cube/SwedishRoyalCastle/nx.jpg",
-				 "textures/cube/SwedishRoyalCastle/py.jpg",
-				 "textures/cube/SwedishRoyalCastle/ny.jpg",
-				 "textures/cube/SwedishRoyalCastle/nz.jpg",
-				 "textures/cube/SwedishRoyalCastle/pz.jpg"
-				],
-		"mapping": "CubeRefractionMapping"
-	},
+	"textures": {
+
+		"cube_reflection": {
+			"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
+					 "textures/cube/SwedishRoyalCastle/nx.jpg",
+					 "textures/cube/SwedishRoyalCastle/py.jpg",
+					 "textures/cube/SwedishRoyalCastle/ny.jpg",
+					 "textures/cube/SwedishRoyalCastle/pz.jpg",
+					 "textures/cube/SwedishRoyalCastle/nz.jpg"
+					]
+		},
+
+		"cube_refraction": {
+			"url": [ "textures/cube/SwedishRoyalCastle/px.jpg",
+					 "textures/cube/SwedishRoyalCastle/nx.jpg",
+					 "textures/cube/SwedishRoyalCastle/py.jpg",
+					 "textures/cube/SwedishRoyalCastle/ny.jpg",
+					 "textures/cube/SwedishRoyalCastle/nz.jpg",
+					 "textures/cube/SwedishRoyalCastle/pz.jpg"
+					],
+			"mapping": "CubeRefractionMapping"
+		},
+
+		"texture_bg": {
+			"url": "textures/cube/SwedishRoyalCastle/pz.jpg"
+		},
+
+		"texture_minecraft": {
+			"url": "textures/minecraft/grass.png",
+			"magFilter": "NearestFilter",
+			"minFilter": "LinearMipMapLinearFilter"
+		}
 
-	"texture_bg": {
-		"url": "textures/cube/SwedishRoyalCastle/pz.jpg"
 	},
 
-	"texture_minecraft": {
-		"url": "textures/minecraft/grass.png",
-		"magFilter": "NearestFilter",
-		"minFilter": "LinearMipMapLinearFilter"
-	}
-
-},
+	"cameras": {
+		"cam1": {
+			"type"  : "perspective",
+			"fov"   : 50,
+			"aspect": 1.33333,
+			"near"  : 1,
+			"far"   : 1000,
+			"position": [0,0,100],
+			"target"  : [0,0,0]
+		},
+
+		"cam2": {
+			"type"  : "ortho",
+			"left"  : 0,
+			"right" : 1024,
+			"top"   : 0,
+			"bottom": 1024,
+			"near"  : 1,
+			"far"   : 1000,
+			"position": [0,0,0],
+			"target"  : [0,0,0]
+		}
 
-"cameras":
-{
-	"cam1": {
-		"type"  : "perspective",
-		"fov"   : 50,
-		"aspect": 1.33333,
-		"near"  : 1,
-		"far"   : 1000,
-		"position": [0,0,100],
-		"target"  : [0,0,0]
 	},
 
-	"cam2": {
-		"type"  : "ortho",
-		"left"  : 0,
-		"right" : 1024,
-		"top"   : 0,
-		"bottom": 1024,
-		"near"  : 1,
-		"far"   : 1000,
-		"position": [0,0,0],
-		"target"  : [0,0,0]
-	}
+	"lights": {
+		"light1": {
+			"type"		 : "directional",
+			"direction"	 : [0,1,1],
+			"color" 	 : 16777215,
+			"intensity"	 : 0.8
+		},
 
-},
+		"light2": {
+			"type"	  : "point",
+			"position": [0,0,0],
+			"color"   : 16777215
+		}
 
-"lights":
-{
-	"light1": {
-		"type"		 : "directional",
-		"direction"	 : [0,1,1],
-		"color" 	 : 16777215,
-		"intensity"	 : 0.8
 	},
 
-	"light2": {
-		"type"	  : "point",
-		"position": [0,0,0],
-		"color"   : 16777215
-	}
-
-},
+	"fogs":	{
+		"basic": {
+			"type": "linear",
+			"color": [1,0,0],
+			"near": 1,
+			"far": 1000
+		},
 
-"fogs":
-{
-	"basic": {
-		"type" : "linear",
-		"color": [1,0,0],
-		"near" : 1,
-		"far"  : 1000
-	},
+		"exponential": {
+			"type": "exp2",
+			"color": [1,1,1],
+			"density": 0.005
+		},
 
-	"exponential": {
-		"type"    : "exp2",
-		"color"   : [1,1,1],
-		"density" : 0.005
+		"black": {
+			"type": "exp2",
+			"color": [0,0,0],
+			"density": 0.005
+		}
 	},
 
-	"black": {
-		"type"    : "exp2",
-		"color"   : [0,0,0],
-		"density" : 0.005
+	"defaults": {
+		"bgcolor": [0,0,0],
+		"bgalpha": 1,
+		"camera": "cam1",
+		"fog": "black"
 	}
-},
-
-"defaults" :
-{
-	"bgcolor" : [0,0,0],
-	"bgalpha" : 1,
-	"camera"  : "cam1",
-	"fog"	  : "black"
-}
 
 }

+ 22 - 3
examples/webgl_loader_scene.html

@@ -169,6 +169,8 @@
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
 
+			var rotatingObjects = [];
+
 			document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 
 			init();
@@ -194,10 +196,10 @@
 
 						if( !material.program ) {
 
-							console.log(m);
 							renderer.initMaterial( material, result.scene.__lights, result.scene.fog );
 
 							count += 1;
+
 							if( count > pieces ) {
 
 								//console.log("xxxxxxxxx");
@@ -275,7 +277,7 @@
 
 				}
 
-				var callbackFinished = function( result ) {
+				var callbackFinished = function ( result ) {
 
 					loaded = result;
 
@@ -297,7 +299,15 @@
 
 					handle_update( result, 1 );
 
-					console.log( result );
+					THREE.SceneUtils.traverseHierarchy( result.scene, function ( child ) {
+
+						if ( child.properties.rotating === true ) {
+
+							rotatingObjects.push( child );
+
+						}
+
+					} );
 
 				}
 
@@ -424,6 +434,15 @@
 
 				camera.lookAt( scene.position );
 
+				for ( var i = 0; i < rotatingObjects.length; i ++ ) {
+
+					var object = rotatingObjects[ i ];
+
+					object.rotation.x += 0.01;
+					object.rotation.y += 0.02;
+
+				}
+
 				renderer.render( scene, camera );
 
 			}

+ 1 - 0
src/core/Object3D.js

@@ -9,6 +9,7 @@ THREE.Object3D = function () {
 	this.id = THREE.Object3DCount ++;
 
 	this.name = '';
+	this.properties = {};
 
 	this.parent = undefined;
 	this.children = [];

+ 6 - 4
src/core/Quaternion.js

@@ -227,11 +227,13 @@ THREE.Quaternion.prototype = {
 	multiply: function ( a, b ) {
 
 		// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
+		var qax = a.x, qay = a.y, qaz = a.z, qaw = a.w,
+		qbx = b.x, qby = b.y, qbz = b.z, qbw = b.w;
 
-		this.x =  a.x * b.w + a.y * b.z - a.z * b.y + a.w * b.x;
-		this.y = -a.x * b.z + a.y * b.w + a.z * b.x + a.w * b.y;
-		this.z =  a.x * b.y - a.y * b.x + a.z * b.w + a.w * b.z;
-		this.w = -a.x * b.x - a.y * b.y - a.z * b.z + a.w * b.w;
+		this.x =  qax * qbw + qay * qbz - qaz * qby + qaw * qbx;
+		this.y = -qax * qbz + qay * qbw + qaz * qbx + qaw * qby;
+		this.z =  qax * qby - qay * qbx + qaz * qbw + qaw * qbz;
+		this.w = -qax * qbx - qay * qby - qaz * qbz + qaw * qbw;
 
 		return this;
 

+ 2 - 5
src/extras/core/CurvePath.js

@@ -167,13 +167,10 @@ THREE.CurvePath.prototype.getBoundingBox = function () {
 			if ( p.z > maxZ ) maxZ = p.z;
 			else if ( p.z < minZ ) minZ = p.z;
 
-			sum.addSelf( p.x, p.y, p.z );
-
-		} else {
+		}
 
-			sum.addSelf( p.x, p.y );
+		sum.addSelf( p );
 
-		}
 	}
 
 	var ret = {

+ 11 - 1
src/loaders/SceneLoader.js

@@ -131,6 +131,7 @@ THREE.SceneLoader.prototype.createScene = function ( json, callbackFinished, url
 
 	}
 
+        // handle all the children from the loaded json and attach them to given parent        
 	function handle_children( parent, children ) {
 
 		var object;
@@ -271,7 +272,16 @@ THREE.SceneLoader.prototype.createScene = function ( json, callbackFinished, url
 
 				}
 
-				// recursive descend if necessary
+				if ( o.properties !== undefined)  {
+
+					for ( var key in o.properties ) {
+
+						var value = o.properties[ key ];
+						object.properties[ key ] = value;
+
+					}
+				}
+
 				if ( o.children !== undefined ) {
 
 					handle_children( object, o.children );