iPhone OpenGL ES - How to Pick

后端 未结 3 821
说谎
说谎 2021-01-05 12:36

I\'m working on an OpenGL ES1 app which displays a 2D grid and allows user to navigate and scale/rotate it. I need to know the exact translation of View Touch coordinates in

3条回答
  •  既然无缘
    2021-01-05 13:14

    Could be possible to do this with GL_MODELVIEW_MATRIX? or GL_MODLVIEW, I´m not modifing the view position, only del modelview. I´m doing this:

                glMatrixMode(GL_MODELVIEW);
    
    // Setup model view matrix
                glLoadIdentity();
                [gAccel GetAccelerometerMatrix:(GLfloat *) matrix headingX:headx headingY: heady headingZ:headz];
    
                // Finally load matrix
                glLoadMatrixf((GLfloat*)matrix);
    
                glPushMatrix();
                glRotatef(-90, 1, 0, 0);
                glScalef(0.0005, 0.0005, 0.0005);
                glTranslatef(x, 0.0, z);
    

    thanks

提交回复
热议问题