3

I have created a line but I'm not able to increase the thickness of it.

Is there something with firstMaterial that I can use to increase the thickness of my line?

Here you are my functions:

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])
    }
Pietro Messineo
  • 777
  • 8
  • 28

1 Answers1

0

What kind of geometry is it? SCNPlane and SCNBox have width and height properties that you can use to specify lenght and thickness of a line. If it's SCNShape you can define the thickness on the path you use to create it.

leonaka
  • 868
  • 1
  • 6
  • 12