Results 1 to 2 of 2

Thread: about draw a cube with diffeient matrix

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    17

    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:
    Code :
     /**
         * 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?

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: about draw a cube with diffeient matrix

    What is gl_para?
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

Similar Threads

  1. Matrix-Matrix multiply [HELP!]
    By AllanMSouza in forum OpenCL
    Replies: 0
    Last Post: 02-06-2013, 06:36 AM
  2. draw 3D cube
    By gandrakar in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 1
    Last Post: 06-14-2010, 01:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •