c# - 没有OpenGL和其他库的粒子系统

标签 c# graphics2d particles particle-system

我必须在 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.

最佳答案

查找 BackgroundWorkerRenderTargetBitmap 它可能最好在 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/

相关文章:

C# 和 Excel 最佳实践

C# 代码设置远程共享从其父目录继承权限

java - 处理自定义 Swing 组件的点击 扩展 JPanel?

java - Rectangle2D,边框丢失了?

java - 将绘图添加到面板

ios - 让我的粒子跟踪 SpriteKit 中场景的移动,甚至在子节点中也是如此

c# - 我应该在表格关闭时取消注册事件吗?

C# 应用程序在 AVG 防病毒软件中出现误报?

ios - Sprite Kit 中的单个粒子和物理

ios - “Unresolved Identifier” 错误 SparkSetupMainController()” 自定义粒子 Photon Swift iOS 应用程序(标准粒子文档程序)