From 20a8039660d97d01a18b393f81d96cc387d85e8b Mon Sep 17 00:00:00 2001 From: Ian Kerr Date: Thu, 23 Feb 2012 11:53:09 -0500 Subject: [PATCH] Adds support for polylist normals, uvs and color vertex elements. --- src/extras/loaders/ColladaLoader.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/extras/loaders/ColladaLoader.js b/src/extras/loaders/ColladaLoader.js index e91304345f..c6daefad68 100644 --- a/src/extras/loaders/ColladaLoader.js +++ b/src/extras/loaders/ColladaLoader.js @@ -2288,7 +2288,12 @@ THREE.ColladaLoader = function () { input = inputs[ k ]; source = sources[ input.source ]; - index = p[ i + ( j * maxOffset ) + input.offset ]; + if ( primitive.vcount ){ + index = p[ i + j ]; + } else { + index = p[ i + ( j * maxOffset ) + input.offset ]; + } + numParams = source.accessor.params.length; idx32 = index * numParams; @@ -2425,7 +2430,11 @@ THREE.ColladaLoader = function () { } - i += maxOffset * vcount; + if ( primitive.vcount ){ + i += vcount; + } else { + i += maxOffset * vcount; + } } @@ -2457,6 +2466,12 @@ THREE.ColladaLoader = function () { this.inputs[ i ].source = vertices.input[ 'POSITION' ].source; + for(var key in vertices.input){ + if(key != 'POSITION'){ + var input = vertices.input[key]; + this.inputs.push(input); + } + } } } -- GitLab