Guest User

Untitled

a guest
Mar 6th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. let tube = SCNCylinder(radius: 0.5, height: 2)
  2. tube.firstMaterial?.diffuse.contents = UIColor.white
  3. tube.firstMaterial?.transparency = 0.4
  4. let nodeTube = SCNNode(geometry: tube)
  5. nodeTube.position = SCNVector3(0, 0, -3)
  6.  
  7. let particleSystem = SCNParticleSystem(named: "FloatingParticleSystem", inDirectory: nil)
  8. particleSystem?.emitterShape = tube
  9. particleSystem?.birthLocation = .volume
  10.  
  11. nodeTube.addParticleSystem(particleSystem!)
  12. nodeTube.addChildNode(nodeTube)
  13.  
  14. sceneView.scene.rootNode.addChildNode(nodeTube)
Add Comment
Please, Sign In to add comment