1
古いコードが見つかりました。ほとんど動作します。Face4をFace3に固定する方法
var geom = new THREE.Geometry();
geom.vertices = testRect.verts();
for (var i = 0; i < verts.length; i+=4) {
geom.faceVertexUvs[0].push([
new THREE.Vector2(1.0 - ((verts[i].x - testRect.x)/testRect.width), 1.0 - ((verts[i].z - testRect.y)/testRect.height)),
new THREE.Vector2(1.0 - ((verts[i+1].x - testRect.x)/testRect.width), 1.0 - ((verts[i+1].z - testRect.y)/testRect.height)),
new THREE.Vector2(1.0 - ((verts[i+2].x - testRect.x)/testRect.width), 1.0 - ((verts[i+2].z - testRect.y)/testRect.height)),
new THREE.Vector2(1.0 - ((verts[i+3].x - testRect.x)/testRect.width), 1.0 - ((verts[i+3].z - testRect.y)/testRect.height))
]);
}
for (var i=0, vl=verts.length; i<vl; i+=4) {
geom.faces.push(new THREE.Face4(i, i+1, i+2, i+3));
}
私は
THREE.Face4 = function (a, b, c, d, normal, color, materialIndex) {
return new THREE.Face3(a, b, c, normal, color, materialIndex);
};
(Face3
へFace4
)それを修正する方法を見つけたが、http://dt-byte.ru/fea28697.png
はそう
for (var i=0, vl=verts.length; i<vl; i+=4) {
geom.faces.push(new THREE.Face4(i, i+1, i+2, i+3));
geom.faces.push(new THREE.Face4(i, i+3, i+2, i+1));
}
実行しようとしました十分なポリゴンが存在しないようですしかし何かが助けになりませんでした(
この問題の解決に役立つ)