Stereo and Texture???

New Message Reply Date view Thread view Subject view Author view

From: ÀÓ¹«Á (yamoo++at++grmanet.sogang.ac.kr)
Date: 10/10/2001 06:33:52


Hi~

I am programming stereo image with pre-made right, left texture.

But I have met strange problem.

The problem is :

First, if only drawing one texture, not problem.

And if drawing same texture several times, not problem.

But If I use glCopyTexImage2DEXT() as below, problem!!!

When I put glass, only left eye can see the image(left buffer).

Right eye can't see image.

Why????

Thanks for the advise


Im, Moo Jin


My program is :

void DRAW_CALLBACK() {
    pfClearChan(chan);
    pfDraw();

    /* post draw */
    pfPushIdentMatrix();
    glDrawBuffer(GL_BACK_LEFT);
    Shading(-1); /* shading left image */
    glDrawBuffer(GL_BACK_RIGHT);
    Shading(1); /* shading right image */
}

void Shading() {
    glEnable(GL_BLEND);
    glBlendFunc(GL_ONE, GL_ONE);
 
    glEnable(GL_TEXTURE_2D);
 
    if(leftorright == -1) /* left */
        glBindTextureEXT(GL_TEXTURE_2D, tex_left);
    else if(leftorright == 1) {/* right */
        glBindTextureEXT(GL_TEXTURE_2D, tex_right);
 
    glBegin(GL_QUADS);
        glColor4f(0.0, 1.0, 1.0, 1.0);
        glTexCoord2f(0.0, 0.0); glVertex3fv(p[0]);
        glTexCoord2f(1.0, 0.0); glVertex3fv(p[1]);
        glTexCoord2f(1.0, 1.0); glVertex3fv(p[2]);
        glTexCoord2f(0.0, 1.0); glVertex3fv(p[3]);
    glEnd();
/*****************************************************
 * if code is finished here, stereo mode is work very well *
 *****************************************************/

    glMatrixMode(GL_COLOR);
    glPushMatrix();
    glLoadMatrixf(cMdf);
    glMultMatrixf(cMs);
 
    glBindTextureEXT(GL_TEXTURE_2D, tex_temp);
    glCopyTexImage2DEXT(GL_TEXTURE_2D, 0, GL_RGBA, 0.0, 0.0, WINX_SIZE, WINY_SIZE, 0);
 
    glPopMatrix();
 
    glClearColor( 0.0, 0.0, 0.0, 0.0 );
    glClear(GL_COLOR_BUFFER_BIT);
 
    glMatrixMode(GL_MODELVIEW);

    glBindTextureEXT(GL_TEXTURE_2D, tex_temp);

    glBegin(GL_QUADS);
            glTexCoord2f(0.0, 0.0); glVertex3fv(p[0]);
            glTexCoord2f(1.0, 0.0); glVertex3fv(p[1]);
            glTexCoord2f(1.0, 1.0); glVertex3fv(p[2]);
            glTexCoord2f(0.0, 1.0); glVertex3fv(p[3]);
    glEnd();
}
/*****************************************************
 * if code is finished here, stereo mode is don't work *
 *****************************************************/



New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Oct 10 2001 - 06:35:29 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.