Skip to main content
gamedev.net
🔒 Locked

cloud modeling - using partical system

Started by apit 3 replies 600+ views
Original Post
apit
apit
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
apit
JY
JY
*snigger* gas anal *snigger*
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
apit
apit
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 ?
apit
uutee
uutee
>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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.