我有一个测地线球体-它是使用THREE.OctahedronGeometry创建的-我想将三角形​​面组合成六边形面,以便可以选择它们。我对如何解决这个问题甚至是可行的不知所措。任何见识将不胜感激。

这是一个例子:


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)

最佳答案

最有可能是不可能的,但是您可以尝试一个非常接近六边形的voronoi图:Spherical Voronoi Tessellation with Java 7: need fix for winding vertices around faces

关于javascript - 在八面体几何THREE.js中选择六边形面,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29174061/

10-13 05:40