I am making some exploding 3D text with Swift SceneKit. Here is the text:
let text = SCNText(string: "Exploding Text", extrusionDepth: 5)
let node = SCNNode(geometry: SCNText)
scene.rootNode.addChildNode(node)
and here is my particle system:
let exp = SCNParticleSystem()
exp.loops = false
exp.birthRate = 5000
exp.emissionDuration = 0.01
exp.spreadingAngle = 180
exp.particleDiesOnCollision = true
exp.particleLifeSpan = 0.5
exp.particleLifeSpanVariation = 0.3
exp.particleVelocity = 500
exp.particleVelocityVariation = 3
exp.particleSize = 0.05
exp.stretchFactor = 0.05
exp.particleColor = UIColor.blueColor()
scene.addParticleSystem(exp, withTransform: SCNMatrix4MakeRotation(0, 0, 0, 0))
Right now the particles emit from a single point in the center of the text. Is there any way to latch the particles to the surface of the text and then run the system to simulate exploding text?
If not, can this be done with any other geometric object like a cube?
You can specify the emitter shape with
particleSystem.emitterShape = aGeometry;
and then specify the "birthLocation" to SCNParticleBirthLocationSurface or SCNParticleBirthLocationVertex
to emit from the surface or vertex of the text/cube
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With