Skip to content

Commit

Permalink
Merge pull request #227 from tsherif/v2.2.0
Browse files Browse the repository at this point in the history
V2.2.0
  • Loading branch information
tsherif committed Nov 24, 2014
2 parents 1f678b1 + 58dfeb4 commit db6e091
Show file tree
Hide file tree
Showing 15 changed files with 400 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = function(grunt) {
"* Author: Nicolas Kassis\n" +
"* Author: Paul Mougel\n" +
"*\n" +
"* three.js (c) 2010-2014 three.js authors, used under the MIT license" +
"* three.js (c) 2010-2014 three.js authors, used under the MIT license\n" +
"*/\n"
},
surface: {
Expand Down
45 changes: 45 additions & 0 deletions build/brainbrowser-2.2.0/brainbrowser.surface-viewer.min.js

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions build/brainbrowser-2.2.0/brainbrowser.volume-viewer.min.js

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/deindex.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a,c,d,e){a=a||[],c=c||[],d=d||[],e=e;var f,g,h,i,j,k,l,m,n,o,p=a.length,q=3*p,r=4*p,s=d.length>0,t={},u={};4===e.length&&(j=!0,f=e[0],g=e[1],h=e[2],i=e[3]);var v=new Float32Array(q),w=s?new Float32Array(q):new Float32Array,x=new Float32Array(r);for(k=0,l=a.length;l>k;k++)b(t,c[3*a[k]],c[3*a[k]+1],c[3*a[k]+2]);for(u.x=t.minX+(t.maxX-t.minX)/2,u.y=t.minY+(t.maxY-t.minY)/2,u.z=t.minZ+(t.maxZ-t.minZ)/2,u.bounding_box=t,k=0;p>k;k+=3)m=3*k,n=4*k,v[m]=c[3*a[k]]-u.x,v[m+1]=c[3*a[k]+1]-u.y,v[m+2]=c[3*a[k]+2]-u.z,v[m+3]=c[3*a[k+1]]-u.x,v[m+4]=c[3*a[k+1]+1]-u.y,v[m+5]=c[3*a[k+1]+2]-u.z,v[m+6]=c[3*a[k+2]]-u.x,v[m+7]=c[3*a[k+2]+1]-u.y,v[m+8]=c[3*a[k+2]+2]-u.z,s&&(w[m]=d[3*a[k]],w[m+1]=d[3*a[k]+1],w[m+2]=d[3*a[k]+2],w[m+3]=d[3*a[k+1]],w[m+4]=d[3*a[k+1]+1],w[m+5]=d[3*a[k+1]+2],w[m+6]=d[3*a[k+2]],w[m+7]=d[3*a[k+2]+1],w[m+8]=d[3*a[k+2]+2]),j?(x[n]=f,x[n+1]=g,x[n+2]=h,x[n+3]=i,x[n+4]=f,x[n+5]=g,x[n+6]=h,x[n+7]=i,x[n+8]=f,x[n+9]=g,x[n+10]=h,x[n+11]=i):(x[n]=e[4*a[k]],x[n+1]=e[4*a[k]+1],x[n+2]=e[4*a[k]+2],x[n+3]=e[4*a[k]+3],x[n+4]=e[4*a[k+1]],x[n+5]=e[4*a[k+1]+1],x[n+6]=e[4*a[k+1]+2],x[n+7]=e[4*a[k+1]+3],x[n+8]=e[4*a[k+2]],x[n+9]=e[4*a[k+2]+1],x[n+10]=e[4*a[k+2]+2],x[n+11]=e[4*a[k+2]+3]);return o={centroid:u,unindexed:{position:v,normal:w,color:x}}}function b(a,b,c,d){(!a.minX||a.minX>b)&&(a.minX=b),(!a.maxX||a.maxX<b)&&(a.maxX=b),(!a.minY||a.minY>c)&&(a.minY=c),(!a.maxY||a.maxY<c)&&(a.maxY=c),(!a.minZ||a.minZ>d)&&(a.minZ=d),(!a.maxZ||a.maxZ<d)&&(a.maxZ=d)}self.addEventListener("message",function(b){var c,d,e,f,g=b.data,h=g.shapes,i=g.vertices,j=g.normals,k=g.colors;for(c=0,d=h.length;d>c;c++)e=h[c],f=a(h[c].indices,i,j,e.color||k),e.centroid=f.centroid,e.unindexed=f.unindexed;self.postMessage(g)})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/freesurferasc.intensity.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var b,c,d,e,f,g,h;for(a=a.trim(),c=a.split("\n"),f=c.length,b=new Float32Array(f),d=parseFloat(c[0].trim().split(/\s+/)[4]),b[0]=d,g=d,h=d,e=1;f>e;e++)d=parseFloat(c[e].trim().split(/\s+/)[4]),b[e]=d,g=Math.min(g,d),h=Math.max(h,d);return{values:b,min:g,max:h}}self.addEventListener("message",function(b){var c=b.data,d=c.data;self.postMessage(a(d))})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/freesurferasc.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var b,c,d,e,f,g,h,i,j={};for(a=a.split("\n"),d=a[1].trim().split(/\s+/),e=parseInt(d[0],10),f=parseInt(d[1],10),b=new Float32Array(3*e),c=new Uint32Array(3*f),h=0;e>h;h++)g=a[h+2].trim().split(/\s+/),i=3*h,b[i]=parseFloat(g[0]),b[i+1]=parseFloat(g[1]),b[i+2]=parseFloat(g[2]);for(h=0;f>h;h++)g=a[h+e+2].trim().split(/\s+/),i=3*h,c[i]=parseInt(g[0],10),c[i+1]=parseInt(g[1],10),c[i+2]=parseInt(g[2],10);return j.type="polygon",j.vertices=b,j.shapes=[{indices:c}],j}self.addEventListener("message",function(b){self.postMessage(a(b.data.data))})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/freesurferbin.intensity.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var c,d,e,f,g,h,i=new DataView(a),j=0,k=b(i);if(j+=3,16777215!==k)return{error:!0,error_message:"Unrecognized file format."};if(d=i.getUint32(j),j+=8,e=i.getUint32(j),j+=4,1!==e)return{error:!0,error_message:"Only one value per vertex supported. Number of values: "+e};for(c=new Float32Array(d),c[0]=f=g=i.getFloat32(j),j+=4,h=1;d>h;h++)c[h]=i.getFloat32(j),f=Math.min(f,c[h]),g=Math.max(g,c[h]),j+=4;return{values:c,min:f,max:g}}function b(a){var b,c=0;for(b=0;3>b;b++)c+=a.getUint8(b)<<8*(3-b-1);return c}self.addEventListener("message",function(b){self.postMessage(a(b.data.data))})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/freesurferbin.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var c,d,e,f,g,h,i=new DataView(a),j=0,k=b(i);if(j+=3,16777214!==k)return{error:!0,error_message:"Only triangle meshes supported."};for(;10!==i.getUint8(j)||10!==i.getUint8(j+1);)j++;for(j+=2,d=i.getUint32(j),j+=4,f=3*i.getUint32(j),j+=4,c=new Float32Array(3*d),e=new Uint32Array(f),g=0;d>g;g++)h=3*g,c[h]=i.getFloat32(j),j+=4,c[h+1]=i.getFloat32(j),j+=4,c[h+2]=i.getFloat32(j),j+=4;for(g=0;f>g;g++)e[g]=i.getUint32(j),j+=4;return{vertices:c,shapes:[{indices:e}]}}function b(a){var b,c=0;for(b=0;3>b;b++)c+=a.getUint8(b)<<8*(3-b-1);return c}self.addEventListener("message",function(b){self.postMessage(a(b.data.data))})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/json.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var e={name:a.name,type:a.type,shapes:[]};return e.vertices=b(a.vertices),a.colors=a.colors||a.color,a.colors&&(e.colors=b(a.colors),(e.vertices.length===e.colors.length||3===e.colors.length)&&(e.colors=c(e.colors))),a.normals&&(e.normals=b(a.normals)),void 0===a.shapes&&(a.shapes=[]),a.indices&&a.shapes.push({indices:a.indices}),a.shapes.forEach(function(a){var c=b(a.indices);a.one_indexed&&d(c),a.color=a.color||a.colors,Array.isArray(a.color)&&3===a.color.length&&a.color.push(1),e.shapes.push({name:a.name,indices:c,color:a.color})}),e}function b(a,c){if(!Array.isArray(a))return[a];if(c=c||0,c===a.length)return[];var d,e,f=[];for(d=0,e=a.length;e>d;d++)f.push.apply(f,b(a[d]));return f}function c(a){var b,c,d,e;for(b=new Float32Array(4*a.length/3),c=d=0,e=a.length;e>c;)b[d++]=a[c++],b[d++]=a[c++],b[d++]=a[c++],b[d++]=1;return b}function d(a){var b,c;for(b=0,c=a.length;c>b;b++)a[b]=a[b]-1}self.addEventListener("message",function(b){self.postMessage(a(JSON.parse(b.data.data)))})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/mniobj.intensity.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var b,c,d,e,f={};for(f.values=a.trim().split(/\s+/).map(parseFloat),d=f.values[0],e=f.values[0],b=1,c=f.values.length;c>b;b++)d=Math.min(d,f.values[b]),e=Math.max(e,f.values[b]);return f.min=d,f.max=e,f}self.addEventListener("message",function(b){var c=b.data,d=c.data;self.postMessage(a(d))})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/mniobj.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a,l){j=a.trim().split(/\s+/).reverse(),k=j.length-1;var m,n,o,p,q,r,s,t=[],u=l.split,v={},w=i();if(v.split=!1,v.type="P"===w?"polygon":"L"===w?"line":w,"polygon"===v.type)b(v),v.num_vertices=parseInt(i(),10),c(v),d(v),v.nitems=parseInt(i(),10);else{if("line"!==v.type)return v.error=!0,void(v.error_message='Invalid MNI Object class: must be "polygon" or "line"');b(v),v.num_vertices=parseInt(i(),10),c(v),v.nitems=parseInt(i(),10)}if(e(v),f(v),g(v),"polygon"===v.type)u&&(v.split=!0,h(v));else if("line"===v.type){for(r=v.indices,s=v.end_indices,q=v.nitems,m=0;q>m;m++){for(o=0===m?0:s[m-1],t.push(r[o]),p=s[m],n=o+1;p-1>n;n++)t.push(r[n]),t.push(r[n]);t.push(r[p-1])}v.indices=t}return v}function b(a){"polygon"===a.type?a.surface_properties={ambient:parseFloat(i()),diffuse:parseFloat(i()),specular_reflectance:parseFloat(i()),specular_scattering:parseFloat(i()),transparency:parseFloat(i())}:"line"===a.type&&(a.surfaceProperties={width:i()})}function c(a){var b,c=3*a.num_vertices,d=new Float32Array(c);for(b=0;c>b;b++)d[b]=parseFloat(i());a.vertices=d}function d(a){var b,c=3*a.num_vertices,d=new Float32Array(c);for(b=0;c>b;b++)d[b]=parseFloat(i());a.normals=d}function e(a){var b,c,d,e=parseInt(i(),10);if(0===e)for(b=new Float32Array(4),c=0;4>c;c++)b[c]=parseFloat(i());else if(1===e)for(d=4*a.num_polygons,b=new Float32Array(d),c=0;d>c;c++)b[c]=parseFloat(i());else if(2===e)for(d=4*a.num_vertices,b=new Float32Array(d),c=0;d>c;c++)b[c]=parseFloat(i());else a.error=!0,a.error_message="Invalid color flag: "+e;a.color_flag=e,a.colors=b}function f(a){var b,c=a.nitems,d=new Uint32Array(c);for(b=0;c>b;b++)d[b]=parseInt(i(),10);a.end_indices=d}function g(a){var b,c=k+1,d=new Float32Array(c);for(b=0;c>b;b++)d[b]=parseInt(i(),10);a.indices=d}function h(a){var b=a.indices.length;a.left={indices:Array.prototype.slice.call(a.indices,0,b/2)},a.right={indices:Array.prototype.slice.call(a.indices,b/2)}}function i(){return j[k--]}var j,k;self.addEventListener("message",function(b){var c=b.data,d=a(c.data,c.options)||{error:!0,error_message:"Error parsing data."},e={type:d.type,vertices:d.vertices,normals:d.normals,colors:d.colors,surface_properties:d.surface_properties,split:d.split,error:d.error,error_message:d.error_message};e.shapes=e.split?[{indices:d.left.indices},{indices:d.right.indices}]:[{indices:d.indices}],self.postMessage(e)})}();
32 changes: 32 additions & 0 deletions build/brainbrowser-2.2.0/workers/wavefrontobj.worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* BrainBrowser: Web-based Neurological Visualization Tools
* (https://brainbrowser.cbrain.mcgill.ca)
*
* Copyright (C) 2011
* The Royal Institution for the Advancement of Learning
* McGill University
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* BrainBrowser v2.2.0
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
* Author: Nicolas Kassis
* Author: Paul Mougel
*
* three.js (c) 2010-2014 three.js authors, used under the MIT license
*/
!function(){"use strict";function a(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[],q=[],r={};for(a=a.split("\n"),r.shapes=[],b={faces:[],indices:[],texture_indices:[],normal_indices:[]},r.shapes.push(b),i=0,l=a.length;l>i;i++)if(f=a[i].replace(/^\s+/,"").replace(/\s+$/,"").split(/\s+/),g=f[0],h=f.length,!g.match("#")||""===f)switch(g){case"o":case"g":b={name:f[1],faces:[],indices:[],texture_indices:[],normal_indices:[]},r.shapes.push(b);break;case"v":o.push(parseFloat(f[1])),o.push(parseFloat(f[2])),o.push(parseFloat(f[3]));break;case"vt":for(j=1;h>j;j++)p.push(parseFloat(f[j]));break;case"vn":q.push(parseFloat(f[1])),q.push(parseFloat(f[2])),q.push(parseFloat(f[3]));break;case"f":m=[],c=b.indices,d=b.texture_indices,e=b.normal_indices;var s=f[1].split("/");for(k=2;h-1>k;k++)m.push(parseInt(s[0],10)-1),c.push(parseInt(s[0],10)-1),d.push(parseInt(s[1],10)-1),s[2]&&e.push(parseInt(s[2],10)-1),n=f[k].split("/"),m.push(parseInt(n[0],10)-1),c.push(parseInt(n[0],10)-1),d.push(parseInt(n[1],10)-1),n[2]&&e.push(parseInt(n[2],10)-1),n=f[k+1].split("/"),m.push(parseInt(n[0],10)-1),c.push(parseInt(n[0],10)-1),d.push(parseInt(n[1],10)-1),n[2]&&e.push(parseInt(n[2],10)-1);b.faces.push(m)}return r.type="polygon",r.vertices=o,r.normals=q,r.texture_coords=p,r}self.addEventListener("message",function(b){self.postMessage(a(b.data.data))})}();
Loading

0 comments on commit db6e091

Please sign in to comment.