Original Post
I have a spiral of particles that I want to place in my game. I also want each particle to always face the player regardless of its position or rotation relative to the spiral.
Pseudo code:
camera->view
translate particle spiral
rotate particle spiral
for each particle {
pushMatrix()
rotate by particle''s angle
translate particle
rotate by particle''s -angle
camera->unview (rotation only)
popMatrix
}
The problem I am having is that the particles look great as long as the spiral rotation is 0,0,0.
If I try to rotate the spiral, the particles no longer consistently face the player. I realize that I have to "undo" the spiral''s rotation, but I cant seem to figure out where to place "UNrotate particle spiral". I thought it would go with "rotate by particle''s -angle" and "camera->unview", but that doesnt seem to work.
Can anyone offer any help ?
Thanks,
Nitzan