View Full Version : Particle engines
12-18-2000, 06:12 AM
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
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?
12-18-2000, 07:30 AM
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 ...
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.
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 )
glOrtho( 0, this->windowwidth, this->windowheight, 0, -1, 1 );
void camera: http://www.opengl.org/discussion_boards/ubb/tongue.giferspective( void )
glMatrixMode( GL_PROJECTION );
glMatrixMode( GL_MODELVIEW );
glEnable( GL_DEPTH_TEST );
12-20-2000, 02:40 AM
Thanks I'll have to try that.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.