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