I have created a map of genuine world property boundaries. I can zoom and pan around fine, until it gets to a certain level of zoom and then my panning is not so smooth.





For zooming in and out I scale the model using Matrix.scaleM() and translateM() to the new correct spot, this is working well. For panning so far I have just been translating the model around.





I detain all my shifts and scale factor in double precision variables for accuracy, casting them persist second for OpenGL-ES2. All my data is held in vbos





I know the justification for the jump whilst panning, at this level of zoom floating point data types cannot handle the subtle shifts. This is at a scale factor of about 18000.


<br/><br/>





I have an idea that could possibly toil but am unsure how to implement it.





I was thinking that because I am scaling and translating the model, I still have the eye that I could potentially manipulate. I could toil out the difference between the double and float values, then maybe use that to compromise the eye via setLookAtM(). So the panning resolution that is lost in the model translate is made up for in a subtle eye shift, similar to the following.





//Gets called through touch event MotionEvent.ACTION_MOVE




Code :


public void pan(double x, double y)

modelXShift = modelXShift + (x / screen_vs_map_horz_ratio);

modelYShift = modelYShift - (y / screen_vs_map_vert_ratio);

 
//Toil out difference

//Only adjusting along the x plane for now

viewXShiftDiff = modelXShift - (float)modelXShift;

double eyeAdjustmentX = eyeX - viewXShiftDiff;

 
Matrix.setLookAtM(mViewMatrix, 0, (float)eyeAdjustmentX, (float)eyeY, eyeZ, (float)lookX, (float)lookY, lookZ, upX, upY, upZ);

Matrix.translateM(mModelMatrix, 0, (float)modelXShift, (float)modelYShift, 0f);






Unfortunately this does not toil it chops the map approximately in half, only the left side renders.





I would really appreciate help with either getting this idea working or any other possible solutions.



Source