提交 97b59934 编写于 作者: M Mr.doob

Merge pull request #6081 from fraguada/fraguada-ObjectLoader-Textures

additional ObjectLoader.js texture maps
......@@ -229,11 +229,83 @@ THREE.ObjectLoader.prototype = {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.map );
}
}
material.map = textures[ data.map ];
}
if ( data.bumpMap ) {
if ( !textures[data.bumpMap] ) {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.bumpMap );
}
material.bumpMap = textures[data.bumpMap];
}
if ( data.alphaMap ) {
if ( !textures[data.alphaMap] ) {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.alphaMap );
}
material.alphaMap = textures[data.alphaMap];
}
if ( data.envMap ) {
if ( !textures[data.envMap] ) {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.envMap );
}
material.envMap = textures[data.envMap];
}
if ( data.normalMap ) {
if ( !textures[data.normalMap] ) {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.normalMap );
}
material.normalMap = textures[data.normalMap];
}
if ( data.lightMap ) {
if ( !textures[data.lightMap] ) {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.lightMap );
}
material.lightMap = textures[data.lightMap];
}
if ( data.specularMap ) {
if ( !textures[data.specularMap] ) {
console.warn( 'THREE.ObjectLoader: Undefined texture', data.specularMap );
}
material.specularMap = textures[data.specularMap];
}
materials[ data.uuid ] = material;
......@@ -437,6 +509,27 @@ THREE.ObjectLoader.prototype = {
object = new THREE.Line( geometry, material );
break;
case 'PointCloud':
var geometry = geometries[ data.geometry ];
var material = materials[ data.material ];
if ( geometry === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined geometry', data.geometry );
}
if ( material === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', data.material );
}
object = new THREE.PointCloud( geometry, material );
break;
case 'Sprite':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册