我们正在尝试使用three.js设置aoMap,但它不是渲染,而lightMap正在处理模型
将uv2设置为几何的代码:
// instantiate a loader
var loader = new THREE.BinaryLoader();
// load a resource
loader.load(
// resource URL
'temp-models/binary/door-boot-01.json',
// Function when resource is loaded
function ( geometry, materials ) {
geometry.sortFacesByMaterialIndex();
geometry.mergeVertices();
geometry = new THREE.BufferGeometry().fromGeometry( geometry );
// self.setupOBJCAR(geometry, materials, self.car.urls.obj[0]);
// return;
loader.load(
// resource URL
'temp-models/binary/door-boot-02.json',
// Function when resource is loaded
function ( geo2, materials ) {
geo2.sortFacesByMaterialIndex();
geo2.mergeVertices();
geo2 = new THREE.BufferGeometry().fromGeometry( geo2 );
var uvs = geo2.attributes.uv.array;
geometry.addAttribute( 'uv2', new THREE.BufferAttribute( uvs, 2 ) );
// console.log(geometry.toJSON());
//Creting Mesh with aoMap in all materials.
}
));
示例链接:
http://design.girnarsoft.com/centraljs/creta3d/index-ao.html