GlLoadMatrix() Problems !!

Hi,

i want to load a matrix with glLoadMatrix() function, simply to translate an object in my scene.

for begining, i replace “glLoadIdentity()” by glLoadMatrix(&aM);

but the result is not self than “glLoadIdentity()” .

Why ?

this is my code:

float aM = {1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};

void Display()
{
glClear(GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT);

//glLoadIdentity();
    glLoadMatrixf(&aM);

    gluLookAt(0,0,10,0,0,0,0,1,0);

    glBegin(GL_TRIANGLES);
        glutSolidSphere(1, 20, 20);
    glEnd();

    glutSwapBuffers();

}

Maybe you should define aM as an array, and not a single float.

At the base, i have used from a bidimensional array (m[4][4]) , and i have converted this in a unidensional array (m[16]). but result as a black screen.

Maybe somebody have a sample of use?

Thank

Yes, change it to an array (float aM[] = …) and then also change the &aM in the function call to just aM without the & character, then it should work fine.

Mikael