项目作者: bialylis

项目描述 :
Thick Red Line - drawing thick lines for SceneKit with metal shaders
高级语言: Metal
项目地址: git://github.com/bialylis/ThickRedLine.git
创建时间: 2018-09-02T16:45:58Z
项目社区:https://github.com/bialylis/ThickRedLine

开源协议:MIT License

下载


ThickRedLine

Thick Red Line - drawing thick lines with constant on-screen width independent of perspective, for SceneKit with metal shaders

Example:

  1. let geometry = SCNGeometry.lineThrough(points: [SCNVector3(0, 0,0), SCNVector3(0, 10, 0), SCNVector3(10, 10, 0)],
  2. width: 20,
  3. closed: false,
  4. color: UIColor.red.cgColor)
  5. let node = SCNNode(geometry: geometry)
  6. scene.rootNode.addChildNode(node)

Thick line gif

Parameters:

  • points - array of SCNVector3 indicating points on the line
  • width - (int) width of line in points
  • closed - (bool) if line should for a loop
  • color - (CGColor) color of the line
  • mitter - (bool) if line should form a sharp mitter at the joints. Feature is WIP - not supported with closed (the first and last joint will not be mittered) and there are artefacts when angle between the lines is too small

img1
img2
img3