Particles Systems

Started by
2 comments, last by Ratman 22 years, 9 months ago
How do do particle systems look in an ISO metric view? Ive written them before for basic top-down 2D games. Im wondering if the perspective would make a "normal" particle system look bad... anyone have any experience with that? --------------- Ratfest.org
Advertisement

You''d need to base your particle system off 3D particles, then render them ISOfied. Something like this:

  struct Particle{  int pos_x; // east/west axis   int pos_y; // north/south axis  int pos_z; // up/down axis  int color;} particle[1000];// rendering pseudocode// assuming -z is up, and on screen ratio// of y to x is like 3:4void render_all_particles(void){    int screen_x;    int screen_y;    for(all particles)    {        screen_x =  particle[i].pos_x;        screen_y = 3*(particle[i].pos_y+particle[i].pos_z)/4 ;        draw_particle(&particle[i], screen_x, screen_y)    }    }  


You''d have to play around with the particle-position-to-screen-position transformation, but I think you get the general idea here.

I think it''d look pretty neat. In fact, I think I will code up something tonight ...




Probably want to do more like

  // these would be precalculatedfloat x_fac = 1.000;float y_fac = cos(view_angle);float z_fac = sin(view_angle);screen_x = x_fac*particle[i].pos_x;screen_y = y_fac*particle[i].pos_y + z_fac*particle[i].pos_z;  


Advantage: you can easily change the ?_fac values to anything you want.

I''d recommend doing a full floating point represenation (or fixed point for those who like that stuff) to prevent float to int conversions.

Thats great thanks. If you can give me any more code/ideas I''d appreciate it, or even an example of what they look like

---------------
Ratfest.org

This topic is closed to new replies.

Advertisement