Answer the question
In order to leave comments, you need to log in
Where can I find an implementation of chaotic particle motion (OpenGL)?
I used to work with DirectX, and for 5 years I didn’t deal with graphics at all. There was a need to write an application, only one thing is required from graphics: drawing points. Those. I have a lot of point objects, I calculate their coordinates on each frame, the points move randomly. More precisely, I would like only to set the initial conditions at random (speed and direction of movement), and then the points collide, bounce, in general, like gas molecules. I started looking towards OpenGL, a lot of some libraries and wrappers appeared, advise what to take? You need a minimal quickstart tutorial, a C / C ++ source from one file, where you work with OpenGL and draw points (so that the code is assembled in Visual Studio). Ideally, there should also be an implementation of collisions (this, of course, is far from one file,
Answer the question
In order to leave comments, you need to log in
Random direction and speed when creating a point. And then already move, collide and do what you want.
For direction, you can store either cosines (a vector) or a right angle.
class Dot
{
public:
Dot()
: speed(rand())
{
double angle = rand()/65535.0 * 360.0/*перевести в радианы надо тут*/;
x = cos( angle );
y = sin( angle );
}
public:
double x, y, speed;
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question