Rotate a particle system

Posted by Blueski on Game Development See other posts from Game Development or by Blueski
Published on 2012-03-05T01:01:56Z Indexed on 2012/04/05 11:44 UTC
Read the original article Hit count: 385

Filed under:
|
|
|
|

Languages / Libraries in use: C++, OpenGL, GLUT

Okay, here's the deal.

I've got a particle system which shoots out alpha blended textures to produce a flame. The system only keeps track of very basic things such as, time alive, life, xyz and spread.

The direction in which the flames are currently moving in is purely based on other things which are going on in my code ( I assume ).

My goal however, is to attach the flame to the camera (DONE) and have the flame pointing in the direction my camera is facing (NOT WORKING).

I've tried glRotate for both x,y,z and I can't get it to work properly.

I'm currently using gluLookAt to move the camera, and get the flame to follow the XYZ of the camera by calling glTranslatef(camX, camY - offset, camZ);

Any suggestions on how I can rotate the direction of the flame with the camera would be greatly appreciated.

Heres an image of what I've got: http://i.imgur.com/YhV4w.png

enter image description here

Notes: Crosshair depicts where camera is facing

if I turn the camera, flame doesn't follow the crosshair

Also asked here: http://stackoverflow.com/questions/9560396/rotate-a-particle-system but was referred here

© Game Development or respective owner

Related posts about c++

Related posts about opengl