我需要一个属性或方法来控制线宽。有用且简单的函数 glLineWidth()
现已弃用:
func glLineWidth(_ width: GLfloat)
我可以使用什么函数来代替已弃用的函数?
这是制作 3D 线的代码:
class func drawLine(vector vector1: SCNVector3,
toVector vector2: SCNVector3) -> SCNGeometry {
let indices: [Int32] = [0, 1]
let source = SCNGeometrySource(vertices: [vector1, vector2]
let element = SCNGeometryElement(indices: indices, primitiveType: .line)
let geometry = SCNGeometry(sources: [source], elements: [element])
return geometry
}
最佳答案
OpenGL 中没有替代品,Metal 中不存在此功能。
关于swift - 替换已弃用的函数 glLineWidth(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57484013/