android Programming Glossary: ondrawframe
Android getOrientation() method returns bad results http://stackoverflow.com/questions/10192057/android-getorientation-method-returns-bad-results GL10.GL_TEXTURE_COORD_ARRAY public void onDrawFrame GL10 gl gl.glPushMatrix gl.glClearColor 0 0 0 1.0f clipping..
Appropriate multiplication of matrices for rotation/translation http://stackoverflow.com/questions/11965593/appropriate-multiplication-of-matrices-for-rotation-translation 0.545867f is added to the Y coordinate on every call to onDrawFrame because of these fields of the Renderer class private static..
YUV to RGB conversion by fragment shader http://stackoverflow.com/questions/12130790/yuv-to-rgb-conversion-by-fragment-shader 0 This is how I bind byte arrays to OpenGL texture in onDrawFrame method GLES20.glUniform1i yTexture 1 GLES20.glTexImage2D GLES20.GL_TEXTURE_2D..
Modifying camera output using SurfaceTexture and OpenGL http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl 0.5f 0.5f 1.0f delegate.startCamera texture public void onDrawFrame GL10 unused float mtx new float 16 GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT..
OpenGL ES Android Matrix Transformations http://stackoverflow.com/questions/13480043/opengl-es-android-matrix-transformations 16 private final float tempMatrix new float 16 public void onDrawFrame GL10 unused Draw background color GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT.. projection matrix is applied to object coordinates in the onDrawFrame method Matrix.frustumM mProjMatrix 0 ratio ratio 1 1 3 7 public.. mTempMatrix new float 16 ... Apply transformations in onDrawFrame start with translation public void onDrawFrame GL10 unused .....
What is the easiest way to draw line using OpenGL-ES (android) http://stackoverflow.com/questions/16027455/what-is-the-easiest-way-to-draw-line-using-opengl-es-android I have custom renderer in opengl es prepared public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT.. over the items and calling the Line.draw method in onDrawFrame. Here are some lines I create to make a horizon Line eastHorz..
Is Opengl Development GPU Dependant? http://stackoverflow.com/questions/17229066/is-opengl-development-gpu-dependant mainActivity myGlsurface myGlsurfaceView public void onDrawFrame GL10 gl line.draw dx dy ux uy @Override public void onSurfaceCreated.. projection matrix is applied to object coordinates in the onDrawFrame method Matrix.frustumM mProjMatrix 0 ratio ratio 1 1 3 7 Take..
How to use onSensorChanged sensor data in combination with OpenGL http://stackoverflow.com/questions/2881128/how-to-use-onsensorchanged-sensor-data-in-combination-with-opengl 16 EGL10.EGL_NONE return configSpec public void onDrawFrame GL10 gl clear screen and color buffer gl.glClear GL10.GL_COLOR_BUFFER_BIT..
Taking screenshot of Android OpenGL http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl to perform a correct screenshot You have to put into Your onDrawFrame GL10 gl handler the following code if screenshot int screenshotSize..
Overlay images onto Camera preview SurfaceView http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview useTranslucentBackground mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT..
How to limit framerate when using Android's GLSurfaceView.RENDERMODE_CONTINUOUSLY? http://stackoverflow.com/questions/4772693/how-to-limit-framerate-when-using-androids-glsurfaceview-rendermode-continuousl then in the render loop public void onDrawFrame GL10 gl endTime System.currentTimeMillis dt endTime startTime..
How to get rid of Jagged edges in Android OpenGL ES? http://stackoverflow.com/questions/4934367/how-to-get-rid-of-jagged-edges-in-android-opengl-es GL10.GL_POLYGON_SMOOTH_HINT GL10.GL_NICEST public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT..
Android OpenGL 3D picking http://stackoverflow.com/questions/6699387/android-opengl-3d-picking ptCloud MatrixGrabber mg new MatrixGrabber ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND..
Problem with getFloatv function in GL11 (Android) http://stackoverflow.com/questions/7125557/problem-with-getfloatv-function-in-gl11-android mCube new Cube previous new float 16 public void onDrawFrame GL10 gl GL11 gl11 GL11 gl gl11.glClear GL11.GL_COLOR_BUFFER_BIT..
Android Camera will not work. startPreview fails http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails GLES20.glCompileShader shader return shader public void onDrawFrame GL10 unused GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT GLES20.GL_DEPTH_BUFFER_BIT..
Android OpenGL Texture Compression http://stackoverflow.com/questions/9148795/android-opengl-texture-compression glCompressedTexImage2D instead of glTexImage2D public void onDrawFrame GL10 gl .... gl.glCompressedTexImage2D GL10.GL_TEXTURE_2D level..
Android getOrientation() method returns bad results http://stackoverflow.com/questions/10192057/android-getorientation-method-returns-bad-results gl.glEnableClientState GL10.GL_VERTEX_ARRAY gl.glEnableClientState GL10.GL_TEXTURE_COORD_ARRAY public void onDrawFrame GL10 gl gl.glPushMatrix gl.glClearColor 0 0 0 1.0f clipping backdrop color clear the color buffer to show the ClearColor..
Appropriate multiplication of matrices for rotation/translation http://stackoverflow.com/questions/11965593/appropriate-multiplication-of-matrices-for-rotation-translation _uBodyCentreMatrix 1 _uBodyCentre 1 zAngle 0 ds 0 The value 0.545867f is added to the Y coordinate on every call to onDrawFrame because of these fields of the Renderer class private static final float _uBodyCentre new float 0.019683f 0.545867f 0.000409f..
YUV to RGB conversion by fragment shader http://stackoverflow.com/questions/12130790/yuv-to-rgb-conversion-by-fragment-shader data V_INDEX vData 0 LENGTH_4 vBuffer.put vData vBuffer.position 0 This is how I bind byte arrays to OpenGL texture in onDrawFrame method GLES20.glUniform1i yTexture 1 GLES20.glTexImage2D GLES20.GL_TEXTURE_2D 0 GLES20.GL_LUMINANCE 320 240 0 GLES20.GL_LUMINANCE..
Modifying camera output using SurfaceTexture and OpenGL http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl texture texture createTexture GLES20.glClearColor 0.5f 0.5f 0.5f 1.0f delegate.startCamera texture public void onDrawFrame GL10 unused float mtx new float 16 GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT GLES20.GL_DEPTH_BUFFER_BIT surface.updateTexImage..
OpenGL ES Android Matrix Transformations http://stackoverflow.com/questions/13480043/opengl-es-android-matrix-transformations new float 16 private final float mModelMatrix new float 16 private final float tempMatrix new float 16 public void onDrawFrame GL10 unused Draw background color GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT Set the camera position View matrix Matrix.setLookAtM.. 0 0 width height float ratio float width height this projection matrix is applied to object coordinates in the onDrawFrame method Matrix.frustumM mProjMatrix 0 ratio ratio 1 1 3 7 public class GLShip public volatile float mAngle private final.. matrix transformations#comment18443759_13480364 private float mTempMatrix new float 16 ... Apply transformations in onDrawFrame start with translation public void onDrawFrame GL10 unused ... Matrix.setIdentityM mModelMatrix 0 initialize to identity..
What is the easiest way to draw line using OpenGL-ES (android) http://stackoverflow.com/questions/16027455/what-is-the-easiest-way-to-draw-line-using-opengl-es-android is the easiest way to draw line using OpenGL ES android If I have custom renderer in opengl es prepared public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT here i want to draw line from 0 0 0 to 1 0 0 What is.. line objects and to a container so the get draw in the by iterating over the items and calling the Line.draw method in onDrawFrame. Here are some lines I create to make a horizon Line eastHorz new Line eastHorz.SetVerts 10f 10f 0f 10f 10f 0f eastHorz.SetColor..
Is Opengl Development GPU Dependant? http://stackoverflow.com/questions/17229066/is-opengl-development-gpu-dependant MyGLsurfaceview myGlsurfaceView Log.i JO MyRenderer this.main mainActivity myGlsurface myGlsurfaceView public void onDrawFrame GL10 gl line.draw dx dy ux uy @Override public void onSurfaceCreated GL10 gl EGLConfig config Log.i JO onSurfaceCreated.. width height width_surface width height_surface height this projection matrix is applied to object coordinates in the onDrawFrame method Matrix.frustumM mProjMatrix 0 ratio ratio 1 1 3 7 Take into account device orientation if width height Matrix.frustumM..
How to use onSensorChanged sensor data in combination with OpenGL http://stackoverflow.com/questions/2881128/how-to-use-onsensorchanged-sensor-data-in-combination-with-opengl the details of the color buffer. int configSpec EGL10.EGL_DEPTH_SIZE 16 EGL10.EGL_NONE return configSpec public void onDrawFrame GL10 gl clear screen and color buffer gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT set target matrix to..
Taking screenshot of Android OpenGL http://stackoverflow.com/questions/3310990/taking-screenshot-of-android-opengl this question Sorry for the late response... In order to perform a correct screenshot You have to put into Your onDrawFrame GL10 gl handler the following code if screenshot int screenshotSize width height ByteBuffer bb ByteBuffer.allocateDirect..
Overlay images onto Camera preview SurfaceView http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview boolean useTranslucentBackground mTranslucentBackground useTranslucentBackground mCube new Cube public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glMatrixMode GL10.GL_MODELVIEW gl.glLoadIdentity..
How to limit framerate when using Android's GLSurfaceView.RENDERMODE_CONTINUOUSLY? http://stackoverflow.com/questions/4772693/how-to-limit-framerate-when-using-androids-glsurfaceview-rendermode-continuousl be somewhere at the start like the constructor startTime System.currentTimeMillis then in the render loop public void onDrawFrame GL10 gl endTime System.currentTimeMillis dt endTime startTime if dt 33 Thread.Sleep 33 dt startTime System.currentTimeMillis..
How to get rid of Jagged edges in Android OpenGL ES? http://stackoverflow.com/questions/4934367/how-to-get-rid-of-jagged-edges-in-android-opengl-es GL10.GL_PERSPECTIVE_CORRECTION_HINT GL10.GL_NICEST gl.glHint GL10.GL_POLYGON_SMOOTH_HINT GL10.GL_NICEST public void onDrawFrame GL10 gl gl.glClear GL10.GL_COLOR_BUFFER_BIT GL10.GL_DEPTH_BUFFER_BIT gl.glLoadIdentity But still the edges are severely..
Android OpenGL 3D picking http://stackoverflow.com/questions/6699387/android-opengl-3d-picking implements GLSurfaceView.Renderer public PointCloud ptCloud MatrixGrabber mg new MatrixGrabber ... public void onDrawFrame GL10 gl gl.glDisable GL10.GL_COLOR_MATERIAL gl.glDisable GL10.GL_BLEND gl.glDisable GL10.GL_LIGHTING Background drawing..
Problem with getFloatv function in GL11 (Android) http://stackoverflow.com/questions/7125557/problem-with-getfloatv-function-in-gl11-android the changes in the code . private float previous public CubeRenderer mCube new Cube previous new float 16 public void onDrawFrame GL10 gl GL11 gl11 GL11 gl gl11.glClear GL11.GL_COLOR_BUFFER_BIT GL11.GL_DEPTH_BUFFER_BIT gl11.glMatrixMode GL11.GL_MODELVIEW..
Android Camera will not work. startPreview fails http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails shader and compile it GLES20.glShaderSource shader shaderCode GLES20.glCompileShader shader return shader public void onDrawFrame GL10 unused GLES20.glClear GLES20.GL_COLOR_BUFFER_BIT GLES20.GL_DEPTH_BUFFER_BIT if camera_texture null return Add program..
Android OpenGL Texture Compression http://stackoverflow.com/questions/9148795/android-opengl-texture-compression founded. Load compressed texture as raw data. Use glCompressedTexImage2D instead of glTexImage2D public void onDrawFrame GL10 gl .... gl.glCompressedTexImage2D GL10.GL_TEXTURE_2D level internalformat width height border imageSize data share..
|