Particle engines

Hi,
I want to be able to draw some faces at paticular x,y,z coodinates and yet have them always face the camera for a particle engine. At the moment I’m using gluLookAt to position the camera but I don’t mind changing to simple tranlsations or rotations if thats the only way to do it. Thanks

Do you mean that the camera can move and you want the faces to rotate so that they will always face the camera?

Hi,

I work on a particle engine and I draw particle in 2D … project the center of the particle then I determine each 2d-vertex easily (as a particle is a quad). So I never had to rotate particle in front of the camera, that is a matrix multiplication by particle !! You can increase your framerate with this method, and u only have to project a point …

The techniques you described is referred to as a “Sprite”. I do not have any example code handy but an internet search should turn up a lot of helpful stuff. Good luck.

I personally use this two routines at the begin of the particle space drawing and at the end… hope someone find 'em usefull…

void camera::viewortho( void )
{
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho( 0, this->windowwidth, this->windowheight, 0, -1, 1 );
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
}

void camera: erspective( void )
{
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
glPopMatrix();
glEnable( GL_DEPTH_TEST );
glEnable(GL_LIGHTING);
}

bye

rIO.sK

Thanks I’ll have to try that.