PDA

View Full Version : Particle engines



Zadkiel
12-18-2000, 06:12 AM
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

softland_gh
12-18-2000, 06:17 AM
Do you mean that the camera can move and you want the faces to rotate so that they will always face the camera?

Arath
12-18-2000, 07:30 AM
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 ...

pleopard
12-18-2000, 08:01 AM
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.

rIO
12-19-2000, 11:16 PM
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: http://www.opengl.org/discussion_boards/ubb/tongue.giferspective( void )
{
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
glPopMatrix();
glEnable( GL_DEPTH_TEST );
glEnable(GL_LIGHTING);
}


bye

rIO.sK

Zadkiel
12-20-2000, 02:40 AM
Thanks I'll have to try that.