2016-11-04 09:23:17
THREE.REVISION "81dev" Blender “2.78”
1、加载OBJ、MTL文件
1 // THREE.Loader.Handlers.add(/.dds$/i, new THREE.DDSLoader() ); 2 var mtlLoader = new THREE.MTLLoader(); 3 mtlLoader.setBaseUrl('libs/obj/'); 4 mtlLoader.setPath('libs/obj/'); 5 6 mtlLoader.load('Tree2.mtl', function(materials){ 7 materials.preload(); 8 //model 9 var objLoader = new THREE.OBJLoader(); 10 objLoader.setMaterials(materials); 11 objLoader.setPath('libs/obj/'); 12 objLoader.load('Tree2.obj',function(object){ 13 // object.traverse(function(child){ 14 // child.material.side = THREE.DoubleSide; 15 // }); 16 object.position.y = 0; 17 object.scale.set(4,4,4); 18 scene.add(object); 19 20 },onProgress, onError); 21 });
效果:
2、Blender Add-ons
Sapling Tree Gen可以直接搜索到
SCA Tree Generator 下载地址:https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Add_Mesh/Add_Space_Tree
在Blender中Shift+A快捷键可以查看是否安装成功