three.js:BufferGeometry和纹理

时间:2014-07-25 18:07:28

标签: javascript three.js buffer-geometry

我试图在THREE.BufferGeometry上加载纹理,但纹理没有显示出来。如果我使用普通几何体,纹理会显示出来。纹理是不支持BufferGeometry还是我做错了什么?

这有效:

var geom = new THREE.BoxGeometry(1,1,1);
var texture = THREE.ImageUtils.loadTexture("texture.png");
var mat = new THREE.MeshPhongMaterial({ map:texture, side:THREE.DoubleSide });
scene.add( new THREE.Mesh(geom, mat) );

这不是

var geom = new THREE.BoxGeometry(1,1,1);
var buffgeom = new THREE.BufferGeometry();
buffgeom.fromGeometry(geom);
var texture = THREE.ImageUtils.loadTexture("texture.png");
var mat = new THREE.MeshPhongMaterial({ map:texture, side:THREE.DoubleSide });
scene.add( new THREE.Mesh(buffgeom, mat) );

1 个答案:

答案 0 :(得分:4)

r68的BufferGeometry.fromGeometry()中有一个错误。

已经在r69dev修复了。