I generate 10 random points. I want connect each point to every another and get faces for every flat area. So, it will nice 3D object with invisible flat faces inside.
How is it possible to make faces from geometry of 10 random points?
var objects3 = [];
var geometrySpline = new THREE.Geometry();
for ( var i = 0; i < 10; i ++ ) {
x = Math.floor(Math.random() * (max - min + 1)) + min;
y = Math.floor(Math.random() * (max - min + 1)) + min;
z = Math.floor(Math.random() * (max - min + 1)) + min;
n = new THREE.Vector3( x, y, z );
objects3.push( n );
}
for ( var x = 0; x < (objects3.length); x ++ ) {
for ( var x2 = 0; x2 < (objects3.length); x2 ++ ) {
geometrySpline.vertices.push(objects3[ x ]);
geometrySpline.vertices.push(objects3[ x2 ]);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…