大佬教程收集整理的这篇文章主要介绍了ios – 场景套件中的彩色线?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
class func linebetweenNodeA(nodeA: SCNNode,nodeB: SCNNodE) -> SCNNode { let positions: [Float32] = [nodeA.position.x,nodeA.position.y,nodeA.position.z,nodeB.position.x,nodeB.position.y,nodeB.position.z] let positionData = NSData(bytes: positions,length: sizeof(Float32)*positions.count) let inDices: [Int32] = [0,1] let indexData = NSData(bytes: inDices,length: sizeof(Int32) * inDices.count) let source = SCNGeometrysource(data: positionData,semantic: SCNGeometrysourceSemanticVertex,vectorCount: inDices.count,floatComponents: true,componentsPerVector: 3,bytesPerComponent: sizeof(Float32),dataOffset: 0,dataStride: sizeof(Float32) * 3) let element = SCNGeometryElement(data: indexData,primitiveType: SCNGeometryPrimitiveType.Line,primitiveCount: inDices.count,bytesPerIndex: sizeof(Int32)) let line = SCNGeometry(sources: [source],elements: [element]) line.firstMaterial?.lighTingModelName = SCNLighTingModelConstant line.firstMaterial?.emission.contents = UIColor.orangeColor() return SCNNode(geometry: linE) }
如何指定绘制线条的颜色?
以上是大佬教程为你收集整理的ios – 场景套件中的彩色线?全部内容,希望文章能够帮你解决ios – 场景套件中的彩色线?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。