本文介绍了SceneKit:有关重现Tron光周期等发光光迹的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标是再现与下面的SceneKit中的图像类似的光迹.线索并不需要那么详细,但其目的是实现类似的视觉效果.

我们尝试使用不透明度为0.5左右的薄立方体.我们将大约200条绳子串在一起,然后将它们连接到一个节点上,以作为光迹.那根本没表现出来.

这另一篇文章建议使用粒子发射器,但是我们还需要检测其他物体撞击轨迹时的碰撞.班级文档说,与粒子发射器的碰撞检测也不起作用.

关于模拟相似光迹的最佳方法的任何建议吗?

一些注意事项:

1)就像在《 Tron》游戏中一样,这些光迹的长度也会增加.对于基本边界,假设将有2000-4000个节点折衷这些光迹(每个玩家大约200个).我们可以将FPS降低到30.

2)这些路径是否可以更好地与设计者提供的图像/网格组合在一起,还是由SCNShapes构建?

3)光迹必须能够检测到碰撞.

感谢您的帮助!

解决方案

可以从几何图形及其边界,几何图形的顶点或整个几何图形的表面发出粒子.这不是一个完整的示例,但这是使用顶点来完成此操作的部分示例:

来自three.js的示例但是如何使用SceneKit实现呢?

因此,您可以动态创建与自行车路径匹配的几何形状,并使它们从顶部和底部边缘发射粒子.但是我还没有弄清楚如何使它们这样做,以表明力/能量/最大轨迹位于自行车后面,然后逐渐消失,而不必对物理轨迹几何形状进行复杂的变形. ..

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!

解决方案

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...

这篇关于SceneKit:有关重现Tron光周期等发光光迹的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 00:09