2 我面临的情况是,我必须从一组世界坐标计算屏幕坐标。我怎么能在opengl android中做到这一点。如何从OpenGL中的世界坐标获取屏幕坐标android 来源 2011-10-25 Prashant Kumar
1 执行gluProject()的逻辑,这只是几个矩阵相乘。 来源 2011-10-25 16:30:38 genpfault +0 作为一个方面说明,链接的文档没有提到在* v“= P x M xv *步骤之后完成的透视分割步骤* v”/ = v“(3)* – +0 嘿,我尝试了gluproject结果是quiyte奇怪...这是我的矩阵和veritces – pritam001 +0 浮子[] MODELVIEW = target.getViewMatrix(); 浮子[]投影= target.getProjectionMatrix(); 浮子[] modelViewprojectionarray = target.getModelViewProjectionMatrix(); int [] view = {0,0,(int)screenWidth,(int)screenHeight}; float x = screenWidth/2,y = screenHeight/2,z = 0.01f; float [] pos = new float [4 ]; GLU.gluProject(x,y,z,modelView,0, projection,0,view,0, pos,0); float xmovedValue = convertPixelsToDp(pos [0],this); float ymovedValue = convertPixelsToDp(pos [1],this); – pritam001
作为一个方面说明,链接的文档没有提到在* v“= P x M xv *步骤之后完成的透视分割步骤* v”/ = v“(3)* –
嘿,我尝试了gluproject结果是quiyte奇怪...这是我的矩阵和veritces – pritam001
浮子[] MODELVIEW = target.getViewMatrix(); 浮子[]投影= target.getProjectionMatrix(); 浮子[] modelViewprojectionarray = target.getModelViewProjectionMatrix(); int [] view = {0,0,(int)screenWidth,(int)screenHeight}; float x = screenWidth/2,y = screenHeight/2,z = 0.01f; float [] pos = new float [4 ]; GLU.gluProject(x,y,z,modelView,0, projection,0,view,0, pos,0); float xmovedValue = convertPixelsToDp(pos [0],this); float ymovedValue = convertPixelsToDp(pos [1],this); – pritam001