使用带有C的opengl模拟粒子系统 [英] simulating particle system using opengl with C

查看:120
本文介绍了使用带有C的opengl模拟粒子系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我试图模拟粒子系统如何形成恒星的过程。我是OpenGL的新手,所以我不知道从哪里开始。我目前正在尝试模拟可能是粒子的物体,但我不知道如何让它们聚集在一起形成一颗星星。



我搜索过互联网指南从哪里开始,但大多数文章指南使用C ++ ...问题是,我可能接近这个项目完全错误的方法,但我不知道如何处理它...我正在咨询数学家仪式现在我建议创建一个粒子,并在随机函数中调用它,我已经这样做但我不习惯opengl所以我有很多显示器的问题...我不想浪费你的时间所以我试图给你一个关于最新情况的全部概述...



我如何让粒子向一个方向移动,因为磁铁会吸引金属,因为它基本上是这样的方法,我想我需要,但我可能错了....







可以有人帮我吗?



谢谢



I am trying to simulate the process of how a star is formed by the particle system. I am new to OpenGL so I have no idea where to start. I am currently trying to simulate objects that would be the particles but I don''t know how to get it to come together to form a star.

I hav searched the internet for guides on where to start but most article guide using C++... the problem is that i mayb approaching this project on a totally wrong approach but i dont know how else to approach it... I am consulting a mathematician rite now n iwas advise to create one particle and call it in a random function and i have done that but i am not used to opengl so i am having alot of problem with the display... I dont want to waste ur time so am trying to give u the entire overview of whats going on...

How do i get the particle to move towards one direction, as a magnet would attract metals cause its basically a method like that i am thinking i need but i may b wrong....



Can anyone help me please?

Thanks

推荐答案

当然,开始的地方不是OpenGL实现,而是物理学?



获取星形成的算法排序首先,使用随机的粒子云(或定义的初始状态)并对其进行处理,直到你最终得到一颗星星,或者模糊地识别为星星的东西。当该死的东西在第一时起作用时担心演示!
Surely, the place to start is not with the OpenGL implementation, but with the physics?

Get your algorithm for star formation sorted first, using a random cloud of particles (or a defined initial state) and process it until you end up with a star, or something vaguely recognisable as a star. Worry about the presentation when the damn thing works in the first place!


这个 [ ^ ]是我能找到的最简单的解释。它分为几个步骤,它包含一些命名的公式,至少会给你一些术语来搜索。
This[^] is the simplest explanation I could find. It is broken down into steps and it contains some named formulae that will at least give you some terms to search on.


正如我们的原始指出的,你首先需要担心的是有一个合理的物理模型,然后是它的表现。

随机运动可能描述一种气体,其中粒子自由移动,即它们没有力(只有碰撞)发生)。另一方面,为了形成粒子的聚集体(像星星一样),你需要加上引力。
As pointed out by our Original, you need to worry first about having a ''reasonable'' physical model and then of its presentation.
Random motion might describe a gas, wherein the particles move freely, that is they under no forces (only collisions happen). On the other hand, in order to form an aggregate of particles (like a star is) you need to add the gravitational force.


这篇关于使用带有C的opengl模拟粒子系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆