Monday, 30 May 2011

particles 5

Bitmask problem solved all i needed to do was set the bitmask as glcolor(1,1,1)
then set glcolour as the particle's colour to draw the main texture

        glPushMatrix();


       
         glColor3f (1,1,1);


        glTranslatef (parts[i].Xpos, parts[i].Ypos, parts[i].Zpos);
        glRotatef (parts[i].Direction - 90, 0, 0, 1);


        glScalef (parts[i].Scalez, parts[i].Scalez, parts[i].Scalez);


        glDisable (GL_DEPTH_TEST);
       glShadeModel(GL_SMOOTH);
        glEnable (GL_BLEND);


        glBlendFunc (GL_DST_COLOR, GL_ZERO);
        glBindTexture (GL_TEXTURE_2D,  texture1[0]);


        glBegin (GL_QUADS);
        glTexCoord2d (0, 0);
        glVertex3f (-1, -1, 0);
        glTexCoord2d (1, 0);
        glVertex3f (1, -1, 0);
        glTexCoord2d (1, 1);
        glVertex3f (1, 1, 0);
        glTexCoord2d (0, 1);
        glVertex3f (-1, 1, 0);
        glEnd();






            glColor3f (parts[i].Red,parts[i].Green,parts[i].Blue);
           
        glBlendFunc (GL_ONE, GL_ONE);


        glBindTexture (GL_TEXTURE_2D,  texture1[1]);


        glBegin (GL_QUADS);
        glTexCoord2d (0, 0);
        glVertex3f (-1, -1, 0);
        glTexCoord2d (1, 0);
        glVertex3f (1, -1, 0);
        glTexCoord2d (1, 1);
        glVertex3f (1, 1, 0);
        glTexCoord2d (0, 1);
        glVertex3f (-1, 1, 0);
        glEnd();




        glEnable(GL_DEPTH_TEST);




        glPopMatrix();





No comments:

Post a Comment