Computer Science Canada

Matrix Cubes

Author:  Catalyst [ Fri Jun 13, 2003 11:57 pm ]
Post subject:  Matrix Cubes

it uses the matrix effect
it involves cubes

give it a couple of seconds to normalize

*glaux needed*

Author:  Martin [ Fri Jun 13, 2003 11:59 pm ]
Post subject: 

Are those cubes or 6 quads? (per box)

Author:  Catalyst [ Sat Jun 14, 2003 12:00 am ]
Post subject: 

they were inteded to be cubes but two of the sides appear to be jutting out (i think it has to do with copying the texture)

Author:  Martin [ Sat Jun 14, 2003 12:01 am ]
Post subject: 

Put your name into the middle box, then output the screen to a whole bunch of bmp's, and then make it into a gif...crazy cool avatar.

Good job. I'd give you bits btw, but I don't think that you care.

Author:  Catalyst [ Sat Jun 14, 2003 12:02 am ]
Post subject: 

solved the problem, though theyre more like boxes now

reuploaded

Author:  Catalyst [ Sat Jun 14, 2003 12:03 am ]
Post subject: 

edit:...

Author:  Homer_simpson [ Sat Jun 14, 2003 2:23 am ]
Post subject: 

how do u do that changing texture stuff?!

Author:  Martin [ Sat Jun 14, 2003 2:25 am ]
Post subject: 

I think we've just been left in the dust...

Author:  Homer_simpson [ Sat Jun 14, 2003 4:33 am ]
Post subject: 

ah... nm... i just found out how... Very Happy

Author:  Martin [ Sat Jun 14, 2003 12:12 pm ]
Post subject: 

Hard? Care to share?

Author:  Homer_simpson [ Sat Jun 14, 2003 12:17 pm ]
Post subject: 

not hard...
i think he's using
code:
glCopyTexImage2D

to intialize his moving texture... (not sure =/)
am i right catalyst?

Author:  Catalyst [ Sat Jun 14, 2003 12:20 pm ]
Post subject: 

ya that what im using
i just draw out the matrix effect
grab the screen into a texture
clear the screen
draw the cubes using that texture
swap buffers

Author:  Homer_simpson [ Sat Jun 14, 2003 1:03 pm ]
Post subject: 

yes i thought so...Very Happy but that matrix effect that your makin with the particle engine is nice... i gotto learn how to use a particle engine...

Author:  Catalyst [ Sat Jun 14, 2003 1:16 pm ]
Post subject: 

NUM_LETT needs to be defined
its the length of the letter trails


code:
float RandomNumP ()
{
return (((float)rand() / (float)(RAND_MAX)));
}

float RandomNum ()
{
return (((float)rand() / (float)(RAND_MAX))*2)-1;
}


code:

class matrixLetter
{
    public:

    float tX1[NUM_LETT],tX2[NUM_LETT],tY1[NUM_LETT],tY2[NUM_LETT];
    bool hLight;
    float x,y,z;
    float xv,yv,zv;
    float sizeX,sizeY;
    int i;
   
    void InitLetter (float l1,float l2,float X,float Y,float Z,float SIZE)
    {
   
    for (i=0;i<NUM_LETT;i++)
    {       

    tX1[i]=(l1)/16;
    tY1[i]=(l2+(float)i)/16;
   
    tX2[i]=((l1+1))/16;
    tY2[i]=((l2+1+(float)i))/16;
    }
   
    x=X;
    y=Y;
    z=Z;
    sizeX=SIZE;
    sizeY=SIZE*1.5;
   
    }
   
    void InitVect (float X,float Y,float Z)
    {
    xv=X;
    yv=Y;
    zv=Z;
   
    }
   
   
    void Reset()
    {
    x=RandomNum()*3;
    y=RandomNum()*2+5;
    z=-6;//-RandomNumP()*-5;
   
    yv=-0.01+RandomNumP()/-100;
   
    }
   
    void RunLetter()
    {
    x+=xv;
    y+=yv;
    z+=zv;   
   
    if (y<-4)
    {
       Reset();
    }
   
    }
   
    void DrawLetter ()
    {
     RunLetter();
     
     for (i=0;i<NUM_LETT;i++)
     {       
     glColor4f (1,1,1,(NUM_LETT-(float)i)/(float)NUM_LETT);

     glTexCoord2f(tX1[i],tY2[i]);
     glVertex3f (x-sizeX,y+sizeY+(sizeY*2*i),z);
 
     glTexCoord2f(tX1[i],tY1[i]);
     glVertex3f (x-sizeX,y-sizeY+(sizeY*2*i),z);
 
     glTexCoord2f(tX2[i],tY1[i]);
     glVertex3f (x+sizeX+0.021,y-sizeY+(sizeY*2*i),z);
 
     glTexCoord2f(tX2[i],tY2[i]);            
     glVertex3f (x+sizeY,y+sizeY+(sizeY*2*i),z); 
     
     }

    }

};

Author:  Homer_simpson [ Sat Jun 14, 2003 8:14 pm ]
Post subject: 

is that a particle engine?!

Author:  Catalyst [ Sat Jun 14, 2003 10:19 pm ]
Post subject: 

no i didnt use a particle engine for it
this code has elements of a particle engine tho


: