gpt4 book ai didi

swift - 增加 SCNGeometry 中的线条粗细

转载 作者:搜寻专家 更新时间:2023-11-01 05:33:58 25 4
gpt4 key购买 nike

<分区>

我创建了一条线,但无法增加它的粗细。

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])
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com