About draw a cube with diffeient matrix

Hi,

now i have a problem at drawing a cube with different matrix in function call glLoadMatrix.
These are the codes i used:

 /**
     * draw c cube*/
    
    // Recalculate the view frustrum
       
    
    TSize size;
    size = this->Size();
    TInt iScreenWidth=size.iWidth;
    TInt iScreenHeight=size.iHeight;
    glViewport( 0, 0, iScreenWidth, iScreenHeight );

    glMatrixMode( GL_PROJECTION );
    
    
    glLoadMatrixf((float*)promat);
    
   
    
    glClearDepthf( 1.0 );
    glClear(GL_DEPTH_BUFFER_BIT);
    glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LEQUAL);

	 

    // Enable vertex arrays.
    glEnableClientState( GL_VERTEX_ARRAY );

    // Set array pointers.
    glVertexPointer( 3, GL_SHORT, 0, cubeVertices);

    glEnableClientState( GL_NORMAL_ARRAY );
    
	glNormalPointer(GL_BYTE,0,cubeNormals);

	glMatrixMode(GL_MODELVIEW);
	
	//glTranslatef(0.0,0.0,300.0);
	//glRotatef(45.0f,0.0f,0.0f,1.0f);
	
	//instead of gl_para,when this array which is like gl_para ,it works
  	
          //float aa[16]={0.976065,-0.040603,0.213698,0.0,   
    		     // -0.006501,-0.987430,-0.157924,0.0,
    		     // 0.217424,0.152753,-0.964050,0.0,
    		    // -32.914699,22.961889,324.126868,1.0};
	
	
         //glLoadMatrixf((float*)aa);
        glLoadMatrixf((float*)gl_para); //gl_para changes every time
        glDrawElements( GL_TRIANGLES, 36, GL_UNSIGNED_BYTE, cubeIndices );

	
    

    glDisable( GL_DEPTH_TEST );
   
    
    CCameraAppBaseContainer* instance=(CCameraAppBaseContainer*)this;
    
    /* Call eglSwapBuffers, which blit the graphics to the window */
    eglSwapBuffers( instance->iEglDisplay, instance->iEglSurface );

when i use a fixed matrix , it works. when i use gl_para, it appears nothing. why? how can i use gl_para in right way?

What is gl_para?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.