I have this one square and when I click on it it stretches so it takes all the screen like shown in these pictures
Before stretching my color picker shows the values real nice
After the stretching when I click just a little below robots legs it gives me value (0,0,255) which is my background color, not the white color I clicked on (255,255,255).
I draw this animation very fast (100 ms) using GLSurfaceView
's setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY)
. The whole animation consists of only 6 frames.
The drawing itself happens from
...
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
do_stretching();
}
}, 0, stretching_frame_delay, TimeUnit.MILLISECONDS);
...
void do_stretching()
{
//change coordinates of white squares vertices kind of "stretching" it
surface_view.requestRenderer();
}
Animation is looking really good and fills all of GLSurfaceView
's area but color picker kind of acts like the last frame wouldn't be drawn and reads the background color which indeed was there before the animation completed. I noticed that if I draw this animation slower thus using more frames I can click a little closer to edges of this image and get the right results but still very close to edges there is this bug that GLES20.glReadPixels
reads the background color even though its actually not visible after the animation completes. What might be the problem here?