[info-performer] glMatrixMode(GL_COLOR) and glLoadMatrixf(<matrix>)

Date view Thread view Subject view Author view

From: faculaganymede (faculaganymede++at++yahoo.com)
Date: 12/08/2003 15:40:18


Hi all,

Has anyone been successful in using
glMatrixMode(GL_COLOR) and glLoadMatrixf(<matrix>) in
their Performer application?

I need to manipulate the RGBA color components of the
framebuffer so new RGBA = (orig RGBA * 4x4 matrix).
In my program, I created a simple triangle and set its
overall color to (0.5, 0.0, 0.5, 1.0)=purple. If
everything works correctly, I should see the color of
the triangle on the screen as new RGBA = (orig RGBA *
4x4 matrix)=(1.0, 0.0, 0.5, 1.0)=pink, but the
triangle remains purple. Matrix is colorMat[16]
below.

I tried other matrices of various values but they
seemed to have no affect on the color of my triangle.
The only thing that seemed to be affected is the color
of the text string "Powered by OpenGL Performer..."
(when running Performer Demo). Please advise!

Here are fragments of my code:
...
chan->setTravFunc(PFTRAV_DRAW,DrawChannel);
...

static GLfloat colorMat[16]={ 1.0f, 0.0f, 0.0f, 0.0f,
                                        0.0f, 1.0f, 0.0f, 0.0f,
                                        1.0f, 0.0f, 1.0f, 0.0f,
                                        0.0f, 0.0f, 0.0f, 1.0f};
...
static void DrawChannel (pfChannel *chan, void *)
{
    chan->clear();

        glMatrixMode(GL_COLOR);
        glLoadMatrixf((const GLfloat*)colorMat);
        glMatrixMode(GL_MODELVIEW):

    pfDraw();
}
...

=====
Thanks,
faculaganymede

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Dec 08 2003 - 15:55:47 PST