Polyhedron
Buffer-geometry short-cut for polyhedron.
// prettier-ignore
const verticesOfCube = [
-1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1,
-1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1,
];
// prettier-ignore
const indicesOfFaces = [
2, 1, 0, 0, 3, 2,
0, 4, 7, 7, 3, 0,
0, 1, 5, 5, 4, 0,
1, 2, 6, 6, 5, 1,
2, 3, 7, 7, 6, 2,
4, 5, 6, 6, 7, 4
];
return (
<Polyhedron args={[verticesOfCube, indicesOfFaces]}>
<meshPhongMaterial attach="material" color="#f3f3f3" />
</Polyhedron>
)