Tag: scnsphere

具有多边形的SCNGeometry作为primitiveType

试图找出如何创build一个多边形SCNGeometry作为primitiveType,我的目标是添加多边形节点作为一个球体节点的孩子,并使它看起来像地图工具包MKPolygon, 就像在这个例子 。 我目前的代码是: //Take an arbitrary array of vectors let vertices: [SCNVector3] = [ SCNVector3Make(-0.1304485, 0.551937, 0.8236193), SCNVector3Make(0.01393811, 0.601815, 0.7985139), SCNVector3Make(0.2971005, 0.5591929, 0.7739732), SCNVector3Make(0.4516893, 0.5150381, 0.7285002), SCNVector3Make(0.4629132, 0.4383712, 0.7704169), SCNVector3Make(0.1333823, 0.5224985, 0.8421428), SCNVector3Make(-0.1684743, 0.4694716, 0.8667254)] //Does polygon shape require indices? let indices: [Int] = [0,1,2,3,4,5,6] let vertexSource = SCNGeometrySource(vertices: vertices) let indexData = Data(bytes: […]