r21nomi / GLRippleView

Custom GLSurfaceView for Android to show image with ripple effect using OpenGL.
228 stars 34 forks source link

Drawing edge of a display is weird #9

Open r21nomi opened 7 years ago

r21nomi commented 7 years ago
MrClaus commented 6 years ago

Hi. This problem still is actual? I think, that problem due to a perspective camera in OpenGl, as a final render does not plane projection of image. Therefore must to change a camera angular view, or - to cut borders of output image )

PriyaSindkar commented 5 years ago

I was able to find a solution to this by increasing the vertex values used for positioning the bitmap in RippleRenderer from 1.0 to 1.1 and 0.0 to 0.1. This crops the image from the borders ever so slightly but now you do not see the unnecessary blank area on the edges.

Code:

private val VERTICES: FloatArray = floatArrayOf(
                -1.1f, 1.1f, 0.1f,  // ↖ left top︎
                -1.1f, -1.1f, 0.1f, // ↙︎ left bottom
                1.1f, 1.1f, 0.1f,   // ↗︎ right top
                1.1f, -1.1f, 0.1f   // ↘︎ right bottom
        )

Maybe this will help others.

r21nomi commented 5 years ago

@PriyaSindkar Thank you for sharing your idea. It might be a good solution. Let me think about it.

r4rashid08 commented 5 years ago

how can i stop the animation