【发布时间】:2014-08-19 22:02:04
【问题描述】:
我正在使用 opengl 在 android 上显示 openstreetmap 数据,到目前为止一切正常,但是在使用相对较大的数据文件 (>10Mo) 时,我的缩放和平移功能不能顺利运行,它太慢了。 在渲染器中我有这些代码行
echelle=OsmGLSurfaceView.mScaleFactor;
Matrix.orthoM(mProjectionMatrix,0, left/ (float)echelle, right/ (float)echelle,bottom/(float)echelle,top/ (float)echelle,1,25);
Matrix.translateM(mProjectionMatrix,0,6*OsmGLSurfaceView.mPosX/(float)echelle,-6*OsmGLSurfaceView.mPosY/(float)echelle,0);
Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mViewMatrix, 0);
osmf.draw(mMVPMatrix);
我在 glsurfaceview 中使用 scalegesturedetector 来获取平移所需的比例因子和 x、y 位置 正如我所说,一切都非常适合非常小的数据文件
我哪里弄错了?
【问题讨论】:
-
请进行分析并在此处发布最耗时的功能。