Skip to content

bialylis/ThickRedLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThickRedLine

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

Example:

let geometry = SCNGeometry.lineThrough(points: [SCNVector3(0, 0,0), SCNVector3(0, 10, 0), SCNVector3(10, 10, 0)],
                                       width: 20,
                                       closed: false,
                                       color: UIColor.red.cgColor)
let node = SCNNode(geometry: geometry)
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

About

Thick Red Line - drawing thick lines for SceneKit with metal shaders

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published