我必须在 C# 中的粒子系统上编写一个程序,并且我正在使用 Visual studio 2010。我不能使用任何像 OpenGl 这样的库,...我只能使用 C# 中的 Graphicisc 库。我尝试阅读一些教程和讲座,但我仍然不知道如何实现。
有人可以帮助我理解我应该如何分解我的问题吗?或者指导我一些有用的教程?这对我来说是新的,我有点陷入困境。
我的任务:
Program a simple generator luminous particles in the shape of a geyser from a point generator, view the particles as different colored dots moving across a single track on a black background in parallel projection.
最佳答案
查找 BackgroundWorker
和 RenderTargetBitmap
它可能最好在 WPF 中执行此操作
伪代码
backgroundWorker()
{
while(isRunning)
{
update()
draw()
}
}
update()
{
for each all particles
{
update gravity and/or relativity to other particles
}
}
draw()
{
clear bitmap
for each all particles
{
draw your particle
}
set it to your container
}
这是基于游戏循环
关于c# - 没有OpenGL和其他库的粒子系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10688687/