2011-01-29 64 views
0
opengl.loadIdentity(); 
    opengl.translate(0,0,0); 

    cnt++; 
    opengl.saveMatrix(); 
     opengl.color4f(1.0f, 0.0f, 1.0f, 0.9f); 

     opengl.selectVertex("proba2").translate(0, 0f, 4.2f-15); 
     opengl.selectVertex("proba2").rotate((int) cnt, 0, 0, 1); 

     opengl.selectVertex("proba2").draw(true); 
    opengl.loadMatrix(); 

    opengl.saveMatrix(); 
    opengl.setOrthoStart(); 

     opengl.color4f(1.0f, 0.0f, 0.0f, 0.9f); 

     opengl.selectVertex("proba3").translate(0, 200); 
     opengl.selectVertex("proba3").rotate((int) cnt, 0, 0, 1); 

     opengl.selectVertex("proba3").draw(true); 
    opengl.setOrthoEnd(); 
    opengl.loadMatrix(); 

我有这段代码。在第一个顶点(它是一个三维顶点)上,它运行良好,只是围绕Z轴旋转(自身绕过)OpenGL ES Ortho2D在其中心旋转

但是第二个状态(2d顶点,邻位),当我走到ortho2D时, Z轴旋转不正常,因为它不在中心点旋转。为什么?

+0

没有人?:(在2D中,旋转点将是左上角的点,但在3D中,旋转点将成为物件中心......为什么? – lacas 2011-01-31 23:44:04

回答

0

这是对我的COORDS错误

我添加坐标:1,100,1,100(上,下,左,右)

当我添加:-50 -50 50 50的工作succesfull !