我已经创建了一条线,但是我不能增加它的粗细。
firstMaterial有什么东西可以用来增加我的线条的厚度吗?
以下是我的函数:
func getDrawnLineFrom(pos1: SCNVector3, toPos2: SCNVector3) -> SCNNode {
let line = lineFrom(vector: pos1, toVector: toPos2)
let lineInBetween1 = SCNNode(geometry: line)
line.firstMaterial?.diffuse.contents = UIColor.blue
return lineInBetween1
}
func lineFrom(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)
return SCNGeometry(sources: [source], elements: [element])
}发布于 2017-08-31 07:02:52
它是哪种几何图形?SCNPlane和SCNBox具有width和height属性,您可以使用它们来指定直线的长度和粗细。如果它是SCNShape,你可以在你用来创建它的路径上定义厚度。
https://stackoverflow.com/questions/45968416
复制相似问题