Advertisement

problems with billboarding

Started by November 21, 2005 08:14 PM
0 comments, last by llvllatrix 19 years ago
hi i am currently having a problem with trying to billboard my particle system when i try and do it the particle system just disappears. below is the code that i am currently using

double matrix[16];
glGetDoublev(GL_MODELVIEW_MATRIX, matrix);
matrix[0] = matrix[5] = matrix[10] = matrix[11] = 1.0;
matrix[1] = matrix[2] = matrix[3] = matrix[4] = 0.0;
matrix[6] = matrix[7] = matrix[8] = matrix[9] = 0.0;
glLoadMatrixd(matrix);


The following is whats in the matrix when the camera is updated 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 just before i try to do billboarding 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 and after i do billboarding(before i popthe matrix) 1 0 0 0 0 1 0 0 0 0 1 1 0 0 1 1 any help with the would be great everyone else in my class has been able to ably the code above and get the correct results and i just don't know whats going wrong
Some theory:
http://www.lighthouse3d.com/opengl/billboarding/index.php?billCheat

You only need to set the upper 3x3 matrix to an identity:
double matrix[16];glGetDoublev(GL_MODELVIEW_MATRIX, matrix);// Always try to keep array assignments like these as clear as possible; it is very easy to make a mistake here.matrix[0] = 1.0;matrix[1] = 0.0;matrix[2] = 0.0;matrix[4] = 0.0;matrix[5] = 1.0;matrix[6] = 0.0;matrix[8] = 0.0;matrix[9] = 0.0;matrix[10] = 1.0;glLoadMatrixd(matrix);


Cheers,
- llvllatrix

This topic is closed to new replies.

Advertisement