Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assignment 3 Particle System

Similar presentations


Presentation on theme: "Assignment 3 Particle System"— Presentation transcript:

1 Assignment 3 Particle System
By TA

2 Structure (for reference)
Particle System Structure (for reference) float life; // Particle Life float r; // Red Value float g; // Green Value float b; // Blue Value float x; // X Position float y; // Y Position float z; // Z Position float xi; // X Direction float yi; // Y Direction float zi; // Z Direction float xg; // X Gravity float yg; // Y Gravity float zg; // Z Gravity

3 Particle System Set the initial status of particles
Update the status of particles in the run time position, velocity, acceleration(optional), life(decrease) if one particle is burned out, reset its status

4 Emitter Structure Position Orientation Particles
The back of the aircraft The reset position of particles Orientation The inverse orientation of the aircraft Particles 1000 particles

5 Load Texture #include <gl\glaux.h> GLuint texture[1]; void LoadTexture(char *Filename) // Loads A Bitmap Image { AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Textures memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL TextureImage[0]=auxDIBImageLoad(Filename)) // Load Particle Texture glGenTextures(1, &texture[0]); // Create One Texture glBindTexture(GL_TEXTURE_2D, texture[0]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data); }


Download ppt "Assignment 3 Particle System"

Similar presentations


Ads by Google