opengl-es

OpenGL-ES: How to set an object at the coordinates of the touch?

故事扮演 提交于 2020-01-05 09:04:38
问题 I'm looking for a way to have an opengl object(triangles etc) at the location on the screen where you touch the screen. I now have an 3D pyramid on the screen, wich moves over the screen, based on the difference between the start of your touch, and where you dragged it to. In normal surfaceViews I could just do something like element.x = event.getX() , but this will not work in openGL. So anyone has an idea? ps: i'm using java/Android. 回答1: OpenGL is nor like a surface view, where each

EAGLView to UIImage timing question

你说的曾经没有我的故事 提交于 2020-01-05 07:51:57
问题 I have a EAGLView that I wish to convert into a UIImage. I can do this with the solution posted here: How to get UIImage from EAGLView? However, I can only accomplish this if a small amount of time has gone by between the creation of the EAGLView and the UIImage. This code, which creates a EAGLView, and then a UIImageView right afterwards, does not work: EAGLView *EAGLphoto = [[EAGLView alloc] initWithImage:photo.workAreaImage]; [theWorkArea.photoArea1 addSubview:EAGLphoto]; //I put a

Drift in rotation about z-axis

删除回忆录丶 提交于 2020-01-05 07:17:12
问题 In an application, while trying to rotate an object using touch, I noticed drift in position of object after sometime (without any translation applied !!). The rotation is only about z-axis and works perfectly, but drift happens only after few rotations. ds will be used for translation (using up-down button). _uNozzleCentreMatrix and _ModelMatrixNozzle will use ds if I correct this. private static final float[] _uNozzleCentre = new float[]{0.0f, 0.333605f, 0.0f, 1.0f}; protected static float[

Drift in rotation about z-axis

我是研究僧i 提交于 2020-01-05 07:17:08
问题 In an application, while trying to rotate an object using touch, I noticed drift in position of object after sometime (without any translation applied !!). The rotation is only about z-axis and works perfectly, but drift happens only after few rotations. ds will be used for translation (using up-down button). _uNozzleCentreMatrix and _ModelMatrixNozzle will use ds if I correct this. private static final float[] _uNozzleCentre = new float[]{0.0f, 0.333605f, 0.0f, 1.0f}; protected static float[

webgl glsl emulate texture3d

▼魔方 西西 提交于 2020-01-05 02:33:09
问题 I'm porting a piece of opengl to webgl and i'm trying to emulate texture3d. Somehow something is going wrong. No interpolation is needed because it is only used for calculations. I'm not sure about the geometry part of the original code, the per layer properties are now fetched trough a texture. Update : Ok i rewrote the texture 3d functions, I still encounter some problems : const vec3 volumeTextureSize = vec3( 256.0, 128.0, 32.0 ); const vec2 imageSize = vec2( 1024.0, 1024.0 ); vec2

Android OpenGL: How to change bitmap attached to texture?

一笑奈何 提交于 2020-01-04 21:39:46
问题 I have created a texture like this public int createTexture(Bitmap bitmap){ final int[] textureHandle = new int[1]; GLES20.glGenTextures(1, textureHandle, 0); glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); // Load the bitmap into the bound texture. GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); return

Android OpenGL: How to change bitmap attached to texture?

安稳与你 提交于 2020-01-04 21:39:07
问题 I have created a texture like this public int createTexture(Bitmap bitmap){ final int[] textureHandle = new int[1]; GLES20.glGenTextures(1, textureHandle, 0); glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); // Load the bitmap into the bound texture. GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); return

Android OpenGL: How to change bitmap attached to texture?

这一生的挚爱 提交于 2020-01-04 21:38:59
问题 I have created a texture like this public int createTexture(Bitmap bitmap){ final int[] textureHandle = new int[1]; GLES20.glGenTextures(1, textureHandle, 0); glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); // Load the bitmap into the bound texture. GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); return

integrating JPCT-ae with QCAR(vuforia)

醉酒当歌 提交于 2020-01-04 11:02:34
问题 i know what i am going to ask is already discussed sometimes but after going through all of them i can't found my complete answer so i am asking a new question when i tried integrating JPCT-ae with QCAR all goes well as expected, i got my modelview matrix from renderframe from jni and successfully transferred that in java to jpct model is shown perfectly as expected. but when i tried to pass this matrix to JPCT world camera my model disappear. my code:in onsurfacechanged: world = new World();

Seamlessly layering transparent sprites in OpenGL ES

你离开我真会死。 提交于 2020-01-04 09:59:15
问题 I am working on an Android app, based on the LibGDX framework (Though I don't think that should affect this problem too much), and I am having trouble finding a way to get the results I want when drawing using transparent sprites. The problem is that the sprites visibly layer on top of each other where they overlap, similar to what is displayed in this image : This is pretty unsightly for some of what I want to do, and even completely breaks other parts. What I would like them to do is merge