2

The goal is to reproduce a light trail similar to the image below in SceneKit. The trail doesn't need to be as detailed, but the idea is to achieve a similar visual effect.

We tried using thin cubes with opacity around 0.5. We strung about 200 together and attached them to a node to act as a light trail. That was not performant at all.

This other post suggests using particle emitters, but we also need to detect collisions when another object hits the trail. Class documentation says collision detection with particle emitters is also not performant.

Any suggestions on the best way to do simulate a similar light trail?

Some considerations:

1) Like in the Tron game, these light trails will grow in length. For basic bounding, assume there will be 2000 - 4000 nodes compromising these light trails (roughly 200 per player). We can drop FPS to around 30.

2) Are these trails better composed with images/meshes from a designer or constructing them out of SCNShapes?

3) The light trails must be capable of detecting collisions.

Thanks for the help!

enter image description here

Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • Is your camera/POV for players fully 3D, and moving around? Or are players limited to where and how they see these trails? – Confused Feb 03 '17 at 10:58
  • yes the camera is moving around. thanks for your help @Confused! – Crashalot Feb 03 '17 at 15:37
  • Sorry, another question... are your trails coming off "bikes" that can do curved corners, or is it more like the original Tron/Centipede style games where they only turn at right angles? – Confused Feb 03 '17 at 17:43
  • Ideally curved corners, but if they have to be right angles, that's a compromise worth making. @Confused – Crashalot Feb 03 '17 at 20:39

1 Answers1

1

Particles can be emitted from geometry, with its bounds, from vertices of the geometry or from randomly all over the surface of geometry. It's not a complete example of this, but here's a partial example of using vertices to do that:

Example from three.js but how to implement using SceneKit?

Because of this, you can create geometry, on the fly, that matches the paths of your bikes, and have them emit particles from their top and bottom edges. But I'm yet to figure out how to make them do so in a way that's indicative of the force/energy/maximum trail being just behind the bike, and then fade out, without having to do complex deformation of a physical trail geometry...

Community
  • 1
  • 1
Confused
  • 6,048
  • 6
  • 34
  • 75