Archived

This topic is now archived and is closed to further replies.

apit

cloud modeling - using partical system

Recommended Posts

apit    122
i have model a cloud.. the problem is, how to animate it.. i don''t really understand about the partical system... which formula should i used to animate the cloud? below is my cloud model source code :: #include <glut.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #define TITIK 2000 typedef GLfloat point3D[3]; typedef point3D gas[TITIK]; gas dot; void Populate(gas anal) { int i=0; GLfloat randx, randy; { while(i (randx * randx + randy * randy) ) { anal[0] = randx; anal[i][1] = randy; anal[i][2] = 0; i++; } } } } void MyInit() { Populate(dot); } int Update() { } void Display(void) { int i; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(100.0, 200.0, 100.0, // eye point 1.0, 0.0, 0.0, // center of view 5.0, 0.0, 1.3); // up glPushMatrix(); glScalef(10.0,10.0,10.0); glColor3f(1.0, 1.0, 1.0); glBegin(GL_QUADS); for (i=0; i

Share this post


Link to post
Share on other sites
apit    122
i''m not really understand..
can you describe it more detail...?
which formula should i use to animate this cloud model?
the code that i paste is for gas.. i just modify it and make it like a cloud...can i did that ?

Share this post


Link to post
Share on other sites
uutee    142
>the problem is, how to animate it..
>i don''t really understand about the partical system...
>which formula should i used to animate the cloud?

Hello earth. Animating clouds using particle systems is not as simple as rendering your particles with GL, learn to live with it.

But to put it simply: find "nice" velocities assigned for each particle in a point in space, and apply (position = position+velocity*deltaTime, for a massless particle) this to the particle position.

I suggest simple translations (a directional "wind" vector) or a little bit of rotations. Also using a stochastical model for turbulent velocities could be quite cool, though I''ve never managed to implement those myself.

- Mikko Kauppila

Share this post


Link to post
Share on other sites