My current project involves working with a geodesic sphere that was initially created using THREE.OctahedronGeometry
. I am looking to group the triangular faces into hexagonal faces for easier selection, but I am unsure of the best approach to solving this problem or if it is even possible. Any advice or insights on this matter would be greatly appreciated.
For reference, below is an example of the code I am currently using:
createGeodesicSphere =->
geometry = new THREE.OctahedronGeometry(200, 3)
material = new THREE.MeshBasicMaterial({
color : 0xFFFFFF,
shading : THREE.FlatShading,
side : THREE.DoubleSide,
vertexColors : THREE.FaceColors,
overdraw : true
})
# Explode geometry so each face has unique vertices
explodeModifier = new THREE.ExplodeModifier()
explodeModifier.modify(geometry)
geodesicMesh = new THREE.Mesh(geometry , material)
geodesicFaces = geometry.faces
for i in [0..geodesicFaces.length-1]
geodesicFaces[i].color.setRGB(Math.random(), Math.random(), Math.random())
geodesicMesh.position.x = 0
geodesicMesh.position.y = 0
geodesicMesh.position.z = 0
scene.add(geodesicMesh)