提交 5fa19e84 编写于 作者: A alteredq

Fixed delays when loading multiple models.

Problem was having too many concurrent workers opened at once. Garbage collection apparently works very slowly on workers. Solution was to close them manually, after model data is sent to main thread.

Also some progress with Blender scene exporter. Some scenes now export correctly, though monkey test scene got worse, even with less hacky code.
上级 9226142a
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
此差异已折叠。
......@@ -8,6 +8,7 @@
* uvs: 0
* colors: 0
* materials: 1
* edges: 0
*
*/
......@@ -15,6 +16,8 @@ var model = {
"version" : 2,
"scale" : 1.000000,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
......@@ -22,13 +25,12 @@ var model = {
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.6400000190734865, 0.10179081114814892, 0.126246120426746],
"colorSpecular" : [0.5, 0.5, 0.5],
"shading" : "Phong",
"specularCoef" : 50,
"transparency" : 1.0,
"vertexColors" : false
}],
"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],
"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.000001,1.000000,-1.000000,-1.000000,1.000000,-1.000000,1.000000,1.000000],
"morphTargets": [],
......@@ -38,8 +40,11 @@ var model = {
"uvs": [[]],
"faces": [3,0,1,2,3,0,3,4,7,6,5,0,3,0,4,5,1,0,3,1,5,6,2,0,3,2,6,7,3,0,3,4,0,3,7,0]
"faces": [3,0,1,2,3,0,3,4,7,6,5,0,3,0,4,5,1,0,3,1,5,6,2,0,3,2,6,7,3,0,3,4,0,3,7,0],
"edges" : []
};
postMessage( model );
close();
......@@ -8,6 +8,7 @@
* uvs: 0
* colors: 0
* materials: 1
* edges: 0
*
*/
......@@ -15,6 +16,8 @@ var model = {
"version" : 2,
"scale" : 1.000000,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
......@@ -22,13 +25,12 @@ var model = {
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.14462547517754842, 0.6400000190734865, 0.24541190036254967],
"colorSpecular" : [0.5, 0.5, 0.5],
"shading" : "Phong",
"specularCoef" : 50,
"transparency" : 1.0,
"vertexColors" : false
}],
"vertices": [1.000000,-0.000000,-1.000000,1.000000,0.000000,1.000000,-1.000000,0.000000,1.000000,-1.000000,-0.000000,-1.000000],
"vertices": [1.000000,1.000000,0.000000,1.000000,-1.000000,0.000000,-1.000000,-1.000000,0.000000,-1.000000,1.000000,0.000000],
"morphTargets": [],
......@@ -38,8 +40,11 @@ var model = {
"uvs": [[]],
"faces": [3,0,3,2,1,0]
"faces": [3,0,3,2,1,0],
"edges" : []
};
postMessage( model );
close();
// Converted from: scene.blend
// File generated with Blender 2.56 Exporter
// https://github.com/alteredq/three.js/tree/master/utils/exporters/blender/
/* Converted from: scene.blend
*
* File generated with Blender 2.56 Exporter
* https://github.com/alteredq/three.js/tree/master/utils/exporters/blender/
*
* objects: 27
* geometries: 3
* materials: 3
* textures: 0
*/
var scene = {
......@@ -15,10 +21,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ 10.623673, 3.370784, -0.321692 ],
"rotation" : [ 0.005265, -0.056306, 4.717181 ],
"quaternion": [ 1.000000, 0.000000, 0.000000, 0.000000 ],
"scale" : [ 8.310000, 4.930000, 0.120000 ],
"position" : [ 10.623673, 0.321692, 3.370784 ],
"rotation" : [ 0.005265, 0.056306, 1.566005 ],
"quaternion": [ 0.708568, -0.017992, 0.021809, 0.705076 ],
"scale" : [ 8.310001, 0.120000, 4.930000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -28,10 +34,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ 1.702659, 0.680278, 5.860421 ],
"rotation" : [ 1.413516, 0.081378, -3.204182 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ 1.702659, -5.860421, 0.680278 ],
"rotation" : [ 1.413516, -0.081378, -3.079003 ],
"quaternion": [ 0.050177, -0.010617, -0.649485, -0.758643 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -41,10 +47,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ 0.081295, 0.639505, 5.808783 ],
"rotation" : [ 1.413516, 0.081378, -3.204182 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ 0.081295, -5.808783, 0.639505 ],
"rotation" : [ 1.413516, -0.081378, -3.079003 ],
"quaternion": [ 0.050177, -0.010617, -0.649485, -0.758643 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -54,10 +60,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -1.569030, 0.619385, 5.747240 ],
"rotation" : [ 1.413516, 0.081378, -3.204182 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ -1.569030, -5.747240, 0.619385 ],
"rotation" : [ 1.413516, -0.081378, -3.079003 ],
"quaternion": [ 0.050177, -0.010617, -0.649485, -0.758643 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -67,10 +73,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -3.129120, 0.552267, 5.709269 ],
"rotation" : [ 1.413516, 0.081378, -3.204182 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ -3.129120, -5.709269, 0.552267 ],
"rotation" : [ 1.413516, -0.081378, -3.079003 ],
"quaternion": [ 0.050177, -0.010617, -0.649485, -0.758643 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -80,10 +86,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -6.386331, 0.382167, 3.004400 ],
"rotation" : [ 1.646237, -0.058425, -1.670593 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ -6.386331, -3.004400, 0.382167 ],
"rotation" : [ 1.646237, 0.058425, 1.670594 ],
"quaternion": [ 0.471896, 0.477057, 0.556810, 0.489585 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -93,10 +99,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -6.499331, 0.471640, 1.593073 ],
"rotation" : [ 1.646237, -0.058425, -1.670593 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ -6.499331, -1.593073, 0.471640 ],
"rotation" : [ 1.646237, 0.058425, 1.670594 ],
"quaternion": [ 0.471896, 0.477057, 0.556810, 0.489585 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -106,10 +112,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -6.629794, 0.533840, 0.234131 ],
"rotation" : [ 1.646237, -0.058425, -1.670593 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ -6.629794, -0.234131, 0.533840 ],
"rotation" : [ 1.646237, 0.058425, 1.670594 ],
"quaternion": [ 0.471896, 0.477057, 0.556810, 0.489585 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -119,10 +125,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -6.713673, 0.629835, -1.008146 ],
"rotation" : [ 1.646237, -0.058425, -1.670593 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"position" : [ -6.713673, 1.008146, 0.629835 ],
"rotation" : [ 1.646237, 0.058425, 1.670594 ],
"quaternion": [ 0.471896, 0.477057, 0.556810, 0.489585 ],
"scale" : [ 0.435837, 0.435837, 0.435837 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -132,10 +138,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -2.010442, 1.387332, 24.343616 ],
"rotation" : [ 1.520470, 0.191726, -3.004622 ],
"quaternion": [ -0.587711, 0.550951, 0.566613, 0.173203 ],
"scale" : [ 9.160007, 9.160007, 9.160008 ],
"position" : [ -2.010442, -24.343616, 1.387332 ],
"rotation" : [ -1.621122, -2.949867, -0.136972 ],
"quaternion": [ 0.016439, -0.116140, -0.679574, -0.724169 ],
"scale" : [ 9.160008, 9.160007, 9.160007 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -145,10 +151,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -4.292194, 1.826282, -7.975398 ],
"rotation" : [ 1.594819, 0.080713, -0.213986 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ -4.292194, 7.975398, 1.826282 ],
"rotation" : [ 1.594819, -0.080713, 0.213986 ],
"quaternion": [ 0.690920, 0.713888, 0.048328, 0.103242 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -158,10 +164,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ 2.151757, 1.891882, -8.065320 ],
"rotation" : [ 1.594819, 0.080713, -0.213986 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ 2.151757, 8.065320, 1.891882 ],
"rotation" : [ 1.594819, -0.080713, 0.213986 ],
"quaternion": [ 0.690920, 0.713888, 0.048328, 0.103242 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -171,10 +177,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -0.712512, 2.115002, -8.097841 ],
"rotation" : [ 1.594819, 0.080713, -0.213986 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ -0.712512, 8.097841, 2.115002 ],
"rotation" : [ 1.594819, -0.080713, 0.213986 ],
"quaternion": [ 0.690920, 0.713888, 0.048328, 0.103242 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -184,10 +190,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ -1.000975, 1.319482, -8.755547 ],
"rotation" : [ 0.000000, 0.000000, -0.000000 ],
"position" : [ -1.000975, 8.755547, 1.319482 ],
"rotation" : [ 0.000000, -0.000000, 0.000000 ],
"quaternion": [ 1.000000, 0.000000, 0.000000, 0.000000 ],
"scale" : [ 6.130000, 1.690000, 0.070000 ],
"scale" : [ 6.130000, 0.070000, 1.690000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -197,10 +203,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ 2.484517, 2.724846, 7.486932 ],
"rotation" : [ 0.220417, -0.075224, 0.181029 ],
"quaternion": [ 0.988791, 0.112836, 0.027288, -0.093898 ],
"scale" : [ 0.350000, 3.310000, 0.890000 ],
"position" : [ 2.484517, -7.486932, 2.724846 ],
"rotation" : [ 0.220417, 0.075224, -0.181029 ],
"quaternion": [ 0.988790, 0.112836, 0.027288, -0.093898 ],
"scale" : [ 0.350000, 0.890000, 3.309999 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -210,10 +216,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ 7.724935, 1.694883, -7.123103 ],
"rotation" : [ 1.835590, 0.083161, -2.048913 ],
"quaternion": [ -0.587711, 0.550951, 0.566613, 0.173203 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ 7.724935, 7.123103, 1.694883 ],
"rotation" : [ 1.835590, -0.083161, 2.048913 ],
"quaternion": [ 0.287189, 0.433893, 0.664936, 0.535835 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -223,10 +229,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -6.334642, 0.566791, -6.636147 ],
"rotation" : [ 1.327136, -0.032561, -4.135900 ],
"quaternion": [ -0.587711, 0.550951, 0.566613, 0.173203 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ -6.334642, 6.636147, 0.566791 ],
"rotation" : [ 1.327136, 0.032561, -2.147285 ],
"quaternion": [ 0.366859, 0.304988, -0.535181, -0.697122 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -236,10 +242,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -5.384042, 0.444915, 6.194087 ],
"rotation" : [ 0.991213, 0.181430, -5.246078 ],
"quaternion": [ -0.587711, 0.550951, 0.566613, 0.173203 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ -5.384042, -6.194087, 0.444915 ],
"rotation" : [ 0.991213, -0.181430, -1.037108 ],
"quaternion": [ 0.782246, 0.371851, -0.303947, -0.396780 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -249,10 +255,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ 3.147747, 1.014840, 4.230884 ],
"rotation" : [ 1.719311, -0.307044, -3.355401 ],
"quaternion": [ -0.587711, 0.550951, 0.566613, 0.173203 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ 3.147747, -4.230884, 1.014840 ],
"rotation" : [ -1.422281, 2.834549, 0.213809 ],
"quaternion": [ 0.046369, -0.179128, 0.733783, 0.653701 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -262,10 +268,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -2.668043, 3.008879, 2.153389 ],
"rotation" : [ 1.881970, 0.457870, 4.066133 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ -2.668043, -2.153389, 3.008879 ],
"rotation" : [ 1.881970, -0.457870, 2.217052 ],
"quaternion": [ 0.091675, 0.470648, 0.644833, 0.595211 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -275,10 +281,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ -3.031251, 0.702044, 1.943665 ],
"rotation" : [ -1.300741, -1.330343, 3.282723 ],
"quaternion": [ 1.000000, 0.000000, 0.000000, 0.000000 ],
"scale" : [ 1.781142, 0.231142, 0.361142 ],
"position" : [ -3.031251, -1.943665, 0.702044 ],
"rotation" : [ 1.840851, 1.811250, -0.141131 ],
"quaternion": [ 0.328619, 0.523567, 0.440581, -0.650981 ],
"scale" : [ 1.781142, 0.361142, 0.231142 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -288,10 +294,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ 1.245307, 0.620196, -0.137285 ],
"rotation" : [ 2.339869, -0.286025, -1.394760 ],
"quaternion": [ -0.587711, 0.550951, 0.566613, 0.173203 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ 1.245307, 0.137285, 0.620196 ],
"rotation" : [ 2.339869, 0.286025, 1.394760 ],
"quaternion": [ 0.380330, 0.662839, 0.627894, 0.147451 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -301,10 +307,10 @@ var scene = {
"geometry" : "geo_Monkey",
"groups" : [ ],
"materials" : [ "Material.002" ],
"position" : [ -0.282500, 1.813606, -4.272932 ],
"rotation" : [ 0.646062, -0.219349, -0.010569 ],
"position" : [ -0.282500, 4.272932, 1.813606 ],
"rotation" : [ 0.646062, 0.219349, 0.010569 ],
"quaternion": [ 0.942751, 0.314982, 0.105460, -0.029764 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -314,10 +320,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ 0.042212, 5.536832, -0.199037 ],
"rotation" : [ 0.000000, 0.000000, -0.000000 ],
"position" : [ 0.042212, 0.199037, 5.536832 ],
"rotation" : [ 0.000000, -0.000000, 0.000000 ],
"quaternion": [ 1.000000, 0.000000, 0.000000, 0.000000 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -327,10 +333,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ -0.395497, 1.009696, -3.944532 ],
"rotation" : [ 0.000000, 0.000000, -0.000000 ],
"position" : [ -0.395497, 3.944532, 1.009696 ],
"rotation" : [ 0.000000, -0.000000, 0.000000 ],
"quaternion": [ 1.000000, 0.000000, 0.000000, 0.000000 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -340,10 +346,10 @@ var scene = {
"geometry" : "geo_Plane",
"groups" : [ ],
"materials" : [ "Material.001" ],
"position" : [ 0.000000, 0.000000, 0.118260 ],
"rotation" : [ 0.000000, 0.000000, -0.000000 ],
"position" : [ 0.000000, -0.118260, 0.000000 ],
"rotation" : [ 0.000000, -0.000000, 0.000000 ],
"quaternion": [ 1.000000, 0.000000, 0.000000, 0.000000 ],
"scale" : [ 7.922787, 7.922787, 7.922787 ],
"scale" : [ 7.922787, 7.922787, 7.922787 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -353,10 +359,10 @@ var scene = {
"geometry" : "geo_Cube",
"groups" : [ ],
"materials" : [ "Material" ],
"position" : [ 3.651978, 1.071144, 0.000000 ],
"rotation" : [ 0.220417, -0.075224, 0.181029 ],
"quaternion": [ 0.988791, 0.112836, 0.027288, -0.093898 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"position" : [ 3.651978, -0.000000, 1.071144 ],
"rotation" : [ 0.220417, 0.075224, -0.181029 ],
"quaternion": [ 0.988790, 0.112836, 0.027288, -0.093898 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
"visible" : true,
"castsShadow" : false,
"meshCollider" : false
......@@ -418,15 +424,22 @@ var scene = {
"lights" :
{
"default_light": {
"type" : "directional",
"direction" : [ 0.000000, 1.000000, 1.000000 ],
"color" : 16777215,
"intensity" : 0.80
}
"default_light": {
"type" : "directional",
"direction" : [ 0.000000, 1.000000, 1.000000 ],
"color" : 16777215,
"intensity" : 0.80
}
},
"transform" :
{
"position" : [ 0.000000, 0.000000, 0.000000 ],
"rotation" : [ -1.570796, 0.000000, 0.000000 ],
"scale" : [ 1.000000, 1.000000, 1.000000 ],
},
"defaults" :
{
"bgcolor" : [ 0.000000, 0.000000, 0.000000 ],
......@@ -437,4 +450,4 @@ var scene = {
}
postMessage( scene );
close();
// Converted from: ../../examples/obj/camaro/CamaroNoUv.obj
// vertices: 53139
// faces: 93251
// faces: 93251
// materials: 9
//
// Generated with OBJ -> Three.js converter
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_threejs_slim.py
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py
var model = {
'materials': [ {
"a_dbg_color" : 0xeeeeee,
"a_dbg_index" : 0,
"a_dbg_name" : "Body",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.22700000000000001, 0.40799999999999997, 0.46300000000000002],
"col_specular" : [2.0, 2.0, 2.0],
"version" : 1,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "Body",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.22700000000000001, 0.40799999999999997, 0.46300000000000002],
"colorSpecular" : [2.0, 2.0, 2.0],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 782.352941,
"opticalDensity" : 1.0,
"specularCoef" : 782.352941,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee0000,
"a_dbg_index" : 1,
"a_dbg_name" : "mirror",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.29999999999999999, 0.29999999999999999, 0.29999999999999999],
"col_specular" : [2.0, 2.0, 2.0],
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "mirror",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.29999999999999999, 0.29999999999999999, 0.29999999999999999],
"colorSpecular" : [2.0, 2.0, 2.0],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 782.352941,
"opticalDensity" : 1.0,
"specularCoef" : 782.352941,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00ee00,
"a_dbg_index" : 2,
"a_dbg_name" : "black",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.10199999999999999, 0.10199999999999999, 0.10199999999999999],
"col_specular" : [0.20000000000000001, 0.20000000000000001, 0.20000000000000001],
"DbgColor" : 60928,
"DbgIndex" : 2,
"DbgName" : "black",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.10199999999999999, 0.10199999999999999, 0.10199999999999999],
"colorSpecular" : [0.20000000000000001, 0.20000000000000001, 0.20000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 7.843137,
"opticalDensity" : 1.0,
"specularCoef" : 7.843137,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x0000ee,
"a_dbg_index" : 3,
"a_dbg_name" : "mizo",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.0, 0.0, 0.0],
"col_specular" : [0.0, 0.0, 0.0],
"DbgColor" : 238,
"DbgIndex" : 3,
"DbgName" : "mizo",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.0, 0.0, 0.0],
"colorSpecular" : [0.0, 0.0, 0.0],
"illumination" : 1,
"optical_density" : 1.0,
"specular_coef" : 0.0,
"opticalDensity" : 1.0,
"specularCoef" : 0.0,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xeeee00,
"a_dbg_index" : 4,
"a_dbg_name" : "glass",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.20000000000000001, 0.31, 0.30599999999999999],
"col_specular" : [2.0, 2.0, 2.0],
"DbgColor" : 15658496,
"DbgIndex" : 4,
"DbgName" : "glass",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.20000000000000001, 0.31, 0.30599999999999999],
"colorSpecular" : [2.0, 2.0, 2.0],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 782.352941,
"opticalDensity" : 1.0,
"specularCoef" : 782.352941,
"transparency" : 0.34
},
{
"a_dbg_color" : 0x00eeee,
"a_dbg_index" : 5,
"a_dbg_name" : "Interieur",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.10199999999999999, 0.10199999999999999, 0.10199999999999999],
"col_specular" : [0.44, 0.44, 0.44],
"DbgColor" : 61166,
"DbgIndex" : 5,
"DbgName" : "Interieur",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.10199999999999999, 0.10199999999999999, 0.10199999999999999],
"colorSpecular" : [0.44, 0.44, 0.44],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee00ee,
"a_dbg_index" : 6,
"a_dbg_name" : "tire",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.27100000000000002, 0.27100000000000002, 0.26300000000000001],
"col_specular" : [0.10000000000000001, 0.10000000000000001, 0.10000000000000001],
"DbgColor" : 15597806,
"DbgIndex" : 6,
"DbgName" : "tire",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.27100000000000002, 0.27100000000000002, 0.26300000000000001],
"colorSpecular" : [0.10000000000000001, 0.10000000000000001, 0.10000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x392456,
"a_dbg_index" : 7,
"a_dbg_name" : "tireling",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.5, 0.5, 0.5],
"col_specular" : [0.20000000000000001, 0.20000000000000001, 0.20000000000000001],
"DbgColor" : 3744854,
"DbgIndex" : 7,
"DbgName" : "tireling",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.5, 0.5, 0.5],
"colorSpecular" : [0.20000000000000001, 0.20000000000000001, 0.20000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x466852,
"a_dbg_index" : 8,
"a_dbg_name" : "black2",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.0, 0.0, 0.0],
"col_specular" : [0.0, 0.0, 0.0],
"DbgColor" : 4614226,
"DbgIndex" : 8,
"DbgName" : "black2",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.0, 0.0, 0.0],
"colorSpecular" : [0.0, 0.0, 0.0],
"illumination" : 1,
"optical_density" : 1.0,
"specular_coef" : 0.0,
"opticalDensity" : 1.0,
"specularCoef" : 0.0,
"transparency" : 1.0
}],
'buffers': 'CamaroNoUv_bin.bin',
"buffers": "CamaroNoUv_bin.bin"
'end': (new Date).getTime()
}
};
postMessage( model );
close();
......@@ -8,6 +8,7 @@
* uvs: 0
* colors: 22
* materials: 1
* edges: 0
*
*/
......@@ -15,6 +16,8 @@ var model = {
"version" : 2,
"scale" : 1.000000,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
......@@ -22,13 +25,12 @@ var model = {
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.800000011920929, 0.800000011920929, 0.800000011920929],
"colorSpecular" : [0.5, 0.5, 0.5],
"shading" : "Phong",
"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.000000,-1.000000,1.000000,0.999999,-1.000000,1.000000,-1.000000],
"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": [],
......@@ -38,8 +40,11 @@ var model = {
"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]
"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" : []
};
postMessage( model );
close();
因为 它太大了无法显示 source diff 。你可以改为 查看blob
// Converted from: ../../examples/obj/f50/F50NoUv.obj
// vertices: 67006
// faces: 97474
// faces: 97474
// materials: 25
//
// Generated with OBJ -> Three.js converter
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_threejs_slim.py
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py
var model = {
'materials': [ {
"a_dbg_color" : 0xeeeeee,
"a_dbg_index" : 0,
"a_dbg_name" : "F50NEGRO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"version" : 1,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "F50NEGRO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee0000,
"a_dbg_index" : 1,
"a_dbg_name" : "F50CROMO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.1004, 0.10352, 0.062719999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "F50CROMO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.1004, 0.10352, 0.062719999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00ee00,
"a_dbg_index" : 2,
"a_dbg_name" : "F50CRIST",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.040800000000000003, 0.15687999999999999, 0.0031199999999999999],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 60928,
"DbgIndex" : 2,
"DbgName" : "F50CRIST",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.040800000000000003, 0.15687999999999999, 0.0031199999999999999],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 0.4
},
{
"a_dbg_color" : 0x0000ee,
"a_dbg_index" : 3,
"a_dbg_name" : "F50ROJO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 238,
"DbgIndex" : 3,
"DbgName" : "F50ROJO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xeeee00,
"a_dbg_index" : 4,
"a_dbg_name" : "F50NEGRO1",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 15658496,
"DbgIndex" : 4,
"DbgName" : "F50NEGRO1",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00eeee,
"a_dbg_index" : 5,
"a_dbg_name" : "F50ALFO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 61166,
"DbgIndex" : 5,
"DbgName" : "F50ALFO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee00ee,
"a_dbg_index" : 6,
"a_dbg_name" : "F50REJIL",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 15597806,
"DbgIndex" : 6,
"DbgName" : "F50REJIL",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xcf36d4,
"a_dbg_index" : 7,
"a_dbg_name" : "F50RIGHT",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 13579988,
"DbgIndex" : 7,
"DbgName" : "F50RIGHT",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x571aa8,
"a_dbg_index" : 8,
"a_dbg_name" : "F50CAPO1",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 5708456,
"DbgIndex" : 8,
"DbgName" : "F50CAPO1",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xf91e1c,
"a_dbg_index" : 9,
"a_dbg_name" : "F50CAPO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 16326172,
"DbgIndex" : 9,
"DbgName" : "F50CAPO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x562b0f,
"a_dbg_index" : 10,
"a_dbg_name" : "F50LEFT",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 5647119,
"DbgIndex" : 10,
"DbgName" : "F50LEFT",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x17be30,
"a_dbg_index" : 11,
"a_dbg_name" : "F50MOTOR",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.1004, 0.10352, 0.062719999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 1556016,
"DbgIndex" : 11,
"DbgName" : "F50MOTOR",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.1004, 0.10352, 0.062719999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x27cd80,
"a_dbg_index" : 12,
"a_dbg_name" : "F50GOOD",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 2608512,
"DbgIndex" : 12,
"DbgName" : "F50GOOD",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xce9ff4,
"a_dbg_index" : 13,
"a_dbg_name" : "F50RUEDA",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 13541364,
"DbgIndex" : 13,
"DbgName" : "F50RUEDA",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xf50be9,
"a_dbg_index" : 14,
"a_dbg_name" : "F50SUELO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 16059369,
"DbgIndex" : 14,
"DbgName" : "F50SUELO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x01a9e7,
"a_dbg_index" : 15,
"a_dbg_name" : "F50DISCO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.41095999999999999, 0.36080000000000001, 0.25728000000000001],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 109031,
"DbgIndex" : 15,
"DbgName" : "F50DISCO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.41095999999999999, 0.36080000000000001, 0.25728000000000001],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x9a8dc9,
"a_dbg_index" : 16,
"a_dbg_name" : "F50FARYE",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.79056000000000004, 0.41095999999999999, 0.0062399999999999999],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 10128841,
"DbgIndex" : 16,
"DbgName" : "F50FARYE",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.79056000000000004, 0.41095999999999999, 0.0062399999999999999],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 0.6
},
{
"a_dbg_color" : 0x60e7a0,
"a_dbg_index" : 17,
"a_dbg_name" : "F5OLOGO",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.41095999999999999, 0.36080000000000001, 0.25728000000000001],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 6350752,
"DbgIndex" : 17,
"DbgName" : "F5OLOGO",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.41095999999999999, 0.36080000000000001, 0.25728000000000001],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x8d5288,
"a_dbg_index" : 18,
"a_dbg_name" : "F50FARED",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.63056000000000001, 0.07528, 0.050160000000000003],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 9261704,
"DbgIndex" : 18,
"DbgName" : "F50FARED",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.63056000000000001, 0.07528, 0.050160000000000003],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 0.7
},
{
"a_dbg_color" : 0x18c267,
"a_dbg_index" : 19,
"a_dbg_name" : "F50FARWD",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.40472000000000002, 0.40472000000000002, 0.40472000000000002],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 1622631,
"DbgIndex" : 19,
"DbgName" : "F50FARWD",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.40472000000000002, 0.40472000000000002, 0.40472000000000002],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 0.7
},
{
"a_dbg_color" : 0xbacfb3,
"a_dbg_index" : 20,
"a_dbg_name" : "F50ASIEN",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 12242867,
"DbgIndex" : 20,
"DbgName" : "F50ASIEN",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xce4a2a,
"a_dbg_index" : 21,
"a_dbg_name" : "F50MATR",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.59919999999999995, 0.58984000000000003, 0.56472],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 13519402,
"DbgIndex" : 21,
"DbgName" : "F50MATR",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.59919999999999995, 0.58984000000000003, 0.56472],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x89463d,
"a_dbg_index" : 22,
"a_dbg_name" : "F50AIRE",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 8996413,
"DbgIndex" : 22,
"DbgName" : "F50AIRE",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.15376000000000001, 0.10983999999999999, 0.037679999999999998],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xb2b942,
"a_dbg_index" : 23,
"a_dbg_name" : "F50TOPAL",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 11712834,
"DbgIndex" : 23,
"DbgName" : "F50TOPAL",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xd8f563,
"a_dbg_index" : 24,
"a_dbg_name" : "F50TOPAL1",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"col_specular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"DbgColor" : 14218595,
"DbgIndex" : 24,
"DbgName" : "F50TOPAL1",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.56159999999999999, 0.043920000000000001, 0.069040000000000004],
"colorSpecular" : [0.025000000000000001, 0.025000000000000001, 0.025000000000000001],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 98.039216,
"opticalDensity" : 1.0,
"specularCoef" : 98.039216,
"transparency" : 1.0
}],
'buffers': 'F50NoUv_bin.bin',
"buffers": "F50NoUv_bin.bin"
'end': (new Date).getTime()
}
};
postMessage( model );
close();
......@@ -100,3 +100,4 @@ var model = {
};
postMessage( model );
close();
......@@ -118,3 +118,4 @@ var model = {
};
postMessage( model );
close();
// Converted from: ../../examples/obj/gallardo/GallardoNoUv.obj
// vertices: 77815
// faces: 75573
// faces: 75573
// materials: 7
//
// Generated with OBJ -> Three.js converter
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_threejs_slim.py
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py
var model = {
'materials': [ {
"a_dbg_color" : 0xeeeeee,
"a_dbg_index" : 0,
"a_dbg_name" : "wire_255255255",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.80000000000000004, 0.80000000000000004, 0.80000000000000004],
"col_specular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"version" : 1,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "wire_255255255",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.80000000000000004, 0.80000000000000004, 0.80000000000000004],
"colorSpecular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 29.411765,
"opticalDensity" : 1.0,
"specularCoef" : 29.411765,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee0000,
"a_dbg_index" : 1,
"a_dbg_name" : "wire_115115115",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.36080000000000001, 0.36080000000000001, 0.36080000000000001],
"col_specular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "wire_115115115",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.36080000000000001, 0.36080000000000001, 0.36080000000000001],
"colorSpecular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 29.411765,
"opticalDensity" : 1.0,
"specularCoef" : 29.411765,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00ee00,
"a_dbg_index" : 2,
"a_dbg_name" : "03___Default",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.13175999999999999, 0.13175999999999999, 0.13175999999999999],
"col_specular" : [0.0, 0.0, 0.0],
"DbgColor" : 60928,
"DbgIndex" : 2,
"DbgName" : "03___Default",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.13175999999999999, 0.13175999999999999, 0.13175999999999999],
"colorSpecular" : [0.0, 0.0, 0.0],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 7.843137,
"opticalDensity" : 1.0,
"specularCoef" : 7.843137,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x0000ee,
"a_dbg_index" : 3,
"a_dbg_name" : "02___Default",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.80000000000000004, 0.0, 0.0],
"col_specular" : [0.65249999999999997, 0.65249999999999997, 0.65249999999999997],
"DbgColor" : 238,
"DbgIndex" : 3,
"DbgName" : "02___Default",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.80000000000000004, 0.0, 0.0],
"colorSpecular" : [0.65249999999999997, 0.65249999999999997, 0.65249999999999997],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 25.490196,
"opticalDensity" : 1.0,
"specularCoef" : 25.490196,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xeeee00,
"a_dbg_index" : 4,
"a_dbg_name" : "wire_255000000",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.80000000000000004, 0.0, 0.0],
"col_specular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"DbgColor" : 15658496,
"DbgIndex" : 4,
"DbgName" : "wire_255000000",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.80000000000000004, 0.0, 0.0],
"colorSpecular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 29.411765,
"opticalDensity" : 1.0,
"specularCoef" : 29.411765,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00eeee,
"a_dbg_index" : 5,
"a_dbg_name" : "wire_252252000",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.79056000000000004, 0.79056000000000004, 0.0],
"col_specular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"DbgColor" : 61166,
"DbgIndex" : 5,
"DbgName" : "wire_252252000",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.79056000000000004, 0.79056000000000004, 0.0],
"colorSpecular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 29.411765,
"opticalDensity" : 1.0,
"specularCoef" : 29.411765,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee00ee,
"a_dbg_index" : 6,
"a_dbg_name" : "wire_132132132",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.41408, 0.41408, 0.41408],
"col_specular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"DbgColor" : 15597806,
"DbgIndex" : 6,
"DbgName" : "wire_132132132",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.41408, 0.41408, 0.41408],
"colorSpecular" : [0.17499999999999999, 0.17499999999999999, 0.17499999999999999],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 29.411765,
"opticalDensity" : 1.0,
"specularCoef" : 29.411765,
"transparency" : 1.0
}],
'buffers': 'GallardoNoUv_bin.bin',
"buffers": "GallardoNoUv_bin.bin"
'end': (new Date).getTime()
}
};
postMessage( model );
close();
......@@ -44,3 +44,4 @@ var model = {
};
postMessage( model );
close();
\ No newline at end of file
......@@ -22,3 +22,4 @@ var model = {
};
postMessage( model );
close();
......@@ -40,3 +40,4 @@ var model = {
};
postMessage( model );
close();
......@@ -86,3 +86,4 @@ var model = {
};
postMessage( model );
close();
......@@ -104,3 +104,4 @@ var model = {
};
postMessage( model );
close();
......@@ -22,3 +22,4 @@ var model = {
};
postMessage( model );
close();
......@@ -22,3 +22,4 @@ var model = {
};
postMessage( model );
close();
......@@ -40,3 +40,4 @@ var model = {
};
postMessage( model );
close();
// Converted from: ../../examples/obj/veyron/VeyronNoUv.obj
// vertices: 36210
// faces: 33034
// faces: 33034
// materials: 8
//
// Generated with OBJ -> Three.js converter
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_threejs_slim.py
// http://github.com/alteredq/three.js/blob/master/utils/exporters/convert_obj_three.py
var model = {
'materials': [ {
"a_dbg_color" : 0xeeeeee,
"a_dbg_index" : 0,
"a_dbg_name" : "08___Default",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.18823999999999999, 0.18823999999999999, 0.18823999999999999],
"col_specular" : [0.14824999999999999, 0.14824999999999999, 0.14824999999999999],
"version" : 1,
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "08___Default",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.18823999999999999, 0.18823999999999999, 0.18823999999999999],
"colorSpecular" : [0.14824999999999999, 0.14824999999999999, 0.14824999999999999],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee0000,
"a_dbg_index" : 1,
"a_dbg_name" : "03___Default",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.52703999999999995, 0.52703999999999995, 0.52703999999999995],
"col_specular" : [0.59999999999999998, 0.59999999999999998, 0.59999999999999998],
"DbgColor" : 15597568,
"DbgIndex" : 1,
"DbgName" : "03___Default",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.52703999999999995, 0.52703999999999995, 0.52703999999999995],
"colorSpecular" : [0.59999999999999998, 0.59999999999999998, 0.59999999999999998],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 37.254902,
"opticalDensity" : 1.0,
"specularCoef" : 37.254902,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00ee00,
"a_dbg_index" : 2,
"a_dbg_name" : "ColorBlack",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.21648000000000001, 0.21648000000000001, 0.21648000000000001],
"col_specular" : [0.75, 0.75, 0.75],
"DbgColor" : 60928,
"DbgIndex" : 2,
"DbgName" : "ColorBlack",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.21648000000000001, 0.21648000000000001, 0.21648000000000001],
"colorSpecular" : [0.75, 0.75, 0.75],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 56.862745,
"opticalDensity" : 1.0,
"specularCoef" : 56.862745,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x0000ee,
"a_dbg_index" : 3,
"a_dbg_name" : "04___Default",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.54271999999999998, 0.57408000000000003, 0.58984000000000003],
"col_specular" : [0.75, 0.75, 0.75],
"DbgColor" : 238,
"DbgIndex" : 3,
"DbgName" : "04___Default",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.54271999999999998, 0.57408000000000003, 0.58984000000000003],
"colorSpecular" : [0.75, 0.75, 0.75],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 66.666667,
"opticalDensity" : 1.0,
"specularCoef" : 66.666667,
"transparency" : 0.5
},
{
"a_dbg_color" : 0xeeee00,
"a_dbg_index" : 4,
"a_dbg_name" : "02___Default",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.48311999999999999, 0.0, 0.0],
"col_specular" : [0.75, 0.75, 0.75],
"DbgColor" : 15658496,
"DbgIndex" : 4,
"DbgName" : "02___Default",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.48311999999999999, 0.0, 0.0],
"colorSpecular" : [0.75, 0.75, 0.75],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 56.862745,
"opticalDensity" : 1.0,
"specularCoef" : 56.862745,
"transparency" : 1.0
},
{
"a_dbg_color" : 0x00eeee,
"a_dbg_index" : 5,
"a_dbg_name" : "Aluminium",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.47055999999999998, 0.47055999999999998, 0.47055999999999998],
"col_specular" : [0.40000000000000002, 0.40000000000000002, 0.40000000000000002],
"DbgColor" : 61166,
"DbgIndex" : 5,
"DbgName" : "Aluminium",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.47055999999999998, 0.47055999999999998, 0.47055999999999998],
"colorSpecular" : [0.40000000000000002, 0.40000000000000002, 0.40000000000000002],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 17.647059,
"opticalDensity" : 1.0,
"specularCoef" : 17.647059,
"transparency" : 1.0
},
{
"a_dbg_color" : 0xee00ee,
"a_dbg_index" : 6,
"a_dbg_name" : "glassRed",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.57408000000000003, 0.0, 0.0],
"col_specular" : [0.75, 0.75, 0.75],
"DbgColor" : 15597806,
"DbgIndex" : 6,
"DbgName" : "glassRed",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.57408000000000003, 0.0, 0.0],
"colorSpecular" : [0.75, 0.75, 0.75],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 66.666667,
"opticalDensity" : 1.0,
"specularCoef" : 66.666667,
"transparency" : 0.5
},
{
"a_dbg_color" : 0x06671a,
"a_dbg_index" : 7,
"a_dbg_name" : "glassOranje",
"col_ambient" : [0.0, 0.0, 0.0],
"col_diffuse" : [0.80000000000000004, 0.49568000000000001, 0.1004],
"col_specular" : [0.75, 0.75, 0.75],
"DbgColor" : 419610,
"DbgIndex" : 7,
"DbgName" : "glassOranje",
"colorAmbient" : [0.0, 0.0, 0.0],
"colorDiffuse" : [0.80000000000000004, 0.49568000000000001, 0.1004],
"colorSpecular" : [0.75, 0.75, 0.75],
"illumination" : 2,
"optical_density" : 1.0,
"specular_coef" : 66.666667,
"opticalDensity" : 1.0,
"specularCoef" : 66.666667,
"transparency" : 0.5
}],
'buffers': 'VeyronNoUv_bin.bin',
"buffers": "VeyronNoUv_bin.bin"
'end': (new Date).getTime()
}
};
postMessage( model );
close();
......@@ -29,3 +29,4 @@ var model = {
};
postMessage( model );
close();
......@@ -47,3 +47,4 @@ var model = {
};
postMessage( model );
close();
......@@ -441,3 +441,4 @@ var scene = {
};
postMessage( scene );
close();
\ No newline at end of file
......@@ -27,6 +27,7 @@ THREE.SceneLoader.prototype = {
result;
data = event.data;
binLoader = new THREE.BinaryLoader();
jsonLoader = new THREE.JSONLoader();
......@@ -46,6 +47,26 @@ THREE.SceneLoader.prototype = {
};
if ( data.transform ) {
var position = data.transform.position,
rotation = data.transform.rotation,
scale = data.transform.scale;
if ( position )
result.scene.position.set( position[ 0 ], position[ 1 ], position [ 2 ] );
if ( rotation )
result.scene.rotation.set( rotation[ 0 ], rotation[ 1 ], rotation [ 2 ] );
if ( scale )
result.scene.scale.set( scale[ 0 ], scale[ 1 ], scale [ 2 ] );
if ( position || rotation || scale )
result.scene.updateMatrix();
}
function get_url( source_url, url_type ) {
if ( url_type == "relativeToHTML" ) {
......@@ -83,31 +104,31 @@ THREE.SceneLoader.prototype = {
r = o.rotation;
q = o.quaternion;
s = o.scale;
// turn off quaternions, for the moment
q = 0;
if ( materials.length == 0 ) {
materials[ 0 ] = new THREE.MeshFaceMaterial();
}
object = new THREE.Mesh( geometry, materials );
object.position.set( p[0], p[1], p[2] );
if ( q ) {
object.quaternion.set( q[0], q[1], q[2], q[3] );
object.useQuaternion = true;
} else {
object.rotation.set( r[0], r[1], r[2] );
}
object.scale.set( s[0], s[1], s[2] );
object.visible = o.visible;
......
......@@ -45,6 +45,10 @@ DEFAULTS = {
"bgcolor" : [0, 0, 0],
"bgalpha" : 1.0,
"position" : [0, 0, 0],
"rotation" : [-math.pi/2, 0, 0],
"scale" : [1, 1, 1],
"camera" :
{
"name" : "default_camera",
......@@ -61,9 +65,9 @@ DEFAULTS = {
{
"name" : "default_light",
"type" : "directional",
"direction" : [0,1,1],
"color" : [1,1,1],
"intensity" : 0.8
"direction" : [0, 1, 1],
"color" : [1, 1, 1],
"intensity" : 0.8
}
}
......@@ -77,10 +81,16 @@ COLORS = [0xeeeeee, 0xee0000, 0x00ee00, 0x0000ee, 0xeeee00, 0x00eeee, 0xee00ee]
# #####################################################
TEMPLATE_SCENE_ASCII = """\
// Converted from: %(fname)s
// File generated with Blender 2.56 Exporter
// https://github.com/alteredq/three.js/tree/master/utils/exporters/blender/
/* Converted from: %(fname)s
*
* File generated with Blender 2.56 Exporter
* https://github.com/alteredq/three.js/tree/master/utils/exporters/blender/
*
* objects: %(nobjects)s
* geometries: %(ngeometries)s
* materials: %(nmaterials)s
* textures: %(ntextures)s
*/
var scene = {
......@@ -89,6 +99,13 @@ var scene = {
%(sections)s
"transform" :
{
"position" : %(position)s,
"rotation" : %(rotation)s,
"scale" : %(scale)s,
},
"defaults" :
{
"bgcolor" : %(bgcolor)s,
......@@ -99,7 +116,7 @@ var scene = {
}
postMessage( scene );
close();
"""
TEMPLATE_SECTION = """
......@@ -117,7 +134,7 @@ TEMPLATE_OBJECT = """\
"position" : %(position)s,
"rotation" : %(rotation)s,
"quaternion": %(quaternion)s,
"scale" : %(scale)s,
"scale" : %(scale)s,
"visible" : true,
"castsShadow" : %(castsShadow)s,
"meshCollider" : %(meshCollider)s
......@@ -230,6 +247,7 @@ var model = {
};
postMessage( model );
close();
"""
TEMPLATE_VERTEX = "%f,%f,%f"
......@@ -648,7 +666,7 @@ def value2string(v):
return str(v).lower()
return str(v)
def generate_materials(mtl, materials, use_colors, draw_type):
def generate_materials(mtl, materials, draw_type):
"""Generate JS array of materials objects
"""
......@@ -663,7 +681,6 @@ def generate_materials(mtl, materials, use_colors, draw_type):
mtl[m]['DbgName'] = m
mtl[m]['DbgIndex'] = index
mtl[m]['DbgColor'] = generate_color(index)
mtl[m]['vertexColors'] = use_colors and mtl[m]["useVertexColors"]
if draw_type in [ "BOUNDS", "WIRE" ]:
mtl[m]['wireframe'] = True
......@@ -675,7 +692,7 @@ def generate_materials(mtl, materials, use_colors, draw_type):
return ",\n\n".join([m for i,m in sorted(mtl_array)]), len(mtl_array)
def extract_materials(mesh, scene):
def extract_materials(mesh, scene, use_colors):
world = scene.world
materials = {}
......@@ -701,6 +718,7 @@ def extract_materials(mesh, scene):
# not sure about mapping values to Blinn-Phong shader
# Blender uses INT from [1,511] with default 0
# http://www.blender.org/documentation/blender_python_api_2_54_0/bpy.types.Material.html#bpy.types.Material.specular_hardness
material["specularCoef"] = m.specular_hardness
if m.active_texture and m.active_texture.type == 'IMAGE' and m.active_texture.image:
......@@ -708,8 +726,8 @@ def extract_materials(mesh, scene):
fn = os.path.normpath(fn)
fn_strip = os.path.basename(fn)
material['mapDiffuse'] = fn_strip
material["useVertexColors"] = m.THREE_useVertexColors
material["vertexColors"] = m.THREE_useVertexColors and use_colors
# can't really use this reliably to tell apart Phong from Lambert
# as Blender defaults to non-zero specular color
......@@ -742,9 +760,9 @@ def generate_materials_string(mesh, scene, use_colors, draw_type):
# extract real materials from the mesh
mtl.update(extract_materials(mesh, scene))
mtl.update(extract_materials(mesh, scene, use_colors))
return generate_materials(mtl, materials, use_colors, draw_type)
return generate_materials(mtl, materials, draw_type)
# #####################################################
# ASCII model generator
......@@ -834,7 +852,6 @@ def export_mesh(obj, scene, filepath,
"""Export single mesh"""
# collapse modifiers into mesh
mesh = obj.create_mesh(scene, True, 'RENDER')
......@@ -845,17 +862,14 @@ def export_mesh(obj, scene, filepath,
# that's what Blender's native export_obj.py does
# to flip YZ
X_ROT = mathutils.Matrix.Rotation(-math.pi/2, 4, 'X')
if export_single_model:
X_ROT = mathutils.Matrix.Rotation(-math.pi/2, 4, 'X')
mesh.transform(X_ROT * obj.matrix_world)
else:
mesh.transform(X_ROT)
mesh.transform(mathutils.Matrix.Scale(option_scale, 4))
mesh.calc_normals()
mesh.transform(mathutils.Matrix.Scale(option_scale, 4))
faceUV = (len(mesh.uv_textures) > 0)
vertexUV = (len(mesh.sticky) > 0)
vertexColors = len(mesh.vertex_colors) > 0
......@@ -958,27 +972,20 @@ def generate_objects(data):
for obj in data["objects"]:
if obj.type == "MESH":
object_id = obj.name
if len(obj.modifiers) > 0:
geo_name = obj.name
else:
geo_name = obj.data.name
geometry_id = "geo_%s" % geo_name
material_ids = generate_material_id_list(obj.material_slots)
group_ids = generate_group_id_list(obj)
#position = obj.location
#rotation = obj.rotation_euler
scale = obj.scale
quaternion = obj.rotation_quaternion
position = [obj.location.x, obj.location.z, -obj.location.y]
rotation = [obj.rotation_euler.x, -obj.rotation_euler.y, -obj.rotation_euler.z]
#quaternion = obj.rotation_euler.to_quat()
scale = [obj.scale.x, obj.scale.z, obj.scale.y]
position, quaternion, scale = obj.matrix_world.decompose()
rotation = quaternion.to_euler("XYZ")
material_string = ""
if len(material_ids) > 0:
material_string = generate_string_list(material_ids)
......@@ -995,16 +1002,18 @@ def generate_objects(data):
"geometry_id" : generate_string(geometry_id),
"group_id" : group_string,
"material_id" : material_string,
"position" : generate_vec3(position),
"rotation" : generate_vec3(rotation),
"quaternion" : generate_vec4(quaternion),
"scale" : generate_vec3(scale),
"castsShadow" : castsShadow,
"meshCollider" : meshCollider
}
chunks.append(object_string)
return ",\n\n".join(chunks)
return ",\n\n".join(chunks), len(chunks)
# #####################################################
# Scene exporter - geometries
......@@ -1036,7 +1045,7 @@ def generate_geometries(data):
geo_set.add(name)
return ",\n\n".join(chunks)
return ",\n\n".join(chunks), len(chunks)
# #####################################################
# Scene exporter - textures
......@@ -1058,7 +1067,7 @@ def generate_textures_scene(data):
}
chunks.append(texture_string)
return ",\n\n".join(chunks)
return ",\n\n".join(chunks), len(chunks)
def extract_texture_filename(image):
fn = bpy.path.abspath(image.filepath)
......@@ -1176,7 +1185,7 @@ def generate_materials_scene(data):
material_string = generate_material_string(material)
chunks.append(material_string)
return ",\n\n".join(chunks)
return ",\n\n".join(chunks), len(chunks)
# #####################################################
# Scene exporter - cameras
......@@ -1257,10 +1266,12 @@ def generate_lights(data):
# #####################################################
def generate_ascii_scene(data):
objects = generate_objects(data)
geometries = generate_geometries(data)
textures = generate_textures_scene(data)
materials = generate_materials_scene(data)
objects, nobjects = generate_objects(data)
geometries, ngeometries = generate_geometries(data)
textures, ntextures = generate_textures_scene(data)
materials, nmaterials = generate_materials_scene(data)
cameras = generate_cameras(data)
lights = generate_lights(data)
......@@ -1284,10 +1295,21 @@ def generate_ascii_scene(data):
parameters = {
"fname" : data["source_file"],
"sections" : sections_string,
"bgcolor" : generate_vec3(DEFAULTS["bgcolor"]),
"bgalpha" : DEFAULTS["bgalpha"],
"defcamera" : generate_string(default_camera)
"defcamera" : generate_string(default_camera),
"nobjects" : nobjects,
"ngeometries" : ngeometries,
"ntextures" : ntextures,
"nmaterials" : nmaterials,
"position" : generate_vec3(DEFAULTS["position"]),
"rotation" : generate_vec3(DEFAULTS["rotation"]),
"scale" : generate_vec3(DEFAULTS["scale"])
}
text = TEMPLATE_SCENE_ASCII % parameters
......
......@@ -196,6 +196,7 @@ var model = {
};
postMessage( model );
close();
"""
TEMPLATE_FILE_BIN = u"""\
......@@ -219,6 +220,7 @@ var model = {
};
postMessage( model );
close();
"""
TEMPLATE_VERTEX = "%f,%f,%f"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册