Hi, i want to use billboarding for a particle-system. I know how to do billboarding, but i am not sure if it is the only and best way. I read it in a book:
// get the modelview matrix
float mat[16];
glGetFloatv(GL_MODELVIEW_MATRIX, mat);
// get the right and up vectors
VECTOR right(mat[0], mat[4], mat[8]);
VECTOR up(mat[1], mat[5], mat[9]);
float size = 2.0f;
// bottom left corner
glVertex3fv((pos + (right + up) * -size).v ());
// bottom right corner
glVertex3fv((pos + (right - up) * size).v ());
// top right corner
glVertex3fv((pos + (right + up) * size).v ());
// top left corner
glVertex3fv((pos + (up - right) * size).v ());
This would create a 4*4 quad. However this is a bit much of work to do, i think. It means many calculations for every single sprite. Do you know, if one could do this easier? I thought it might be possible to rotate the camera in a way so that every quad i draw in the xy-plane should be parallel to the screeen.
I hope you understand what i mean.
Thanks,
Jan.