opengl-es

ExceptionInInitializerError

巧了我就是萌 提交于 2019-12-13 01:56:16
问题 I'm trying to initialize GL11 because i was having troubling referencing a method that had GL11 gl as its argument. I tried to initialize it in my renderer class but it didn't work so I figured that it the initialization was messing with the renderer and created a new class to initialize in. import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import

OpenGL coloured bitmap font with white outline

孤人 提交于 2019-12-13 01:43:32
问题 I've got a libgdx game where I want to use a bitmap font with an outline. I want to be able to set the font colour using setColor(), however, I always want the outline to remain white. What's the best way for me to achieve this? I'm assuming I should do the required colour manipulation using the fragment shader. I've created a bitmap font as below, with red representing the stroke and green representing the set colour. I'm a little stuck with what I need to do in the fragment shader however.

How to rotate a camera view in OpenGL 2.0 ES

半城伤御伤魂 提交于 2019-12-13 01:28:48
问题 I want to make a 360-world using OpenGL 2.0 ES on Smart phone. And I want to make camera view follow the Smart phone Sensor using a quaternion , like an youtube 360 video or an Oculus. I get a Quarternion value using public void setquaternion(...) Function. I change the Quarternion values to 4x4 rotate matrix using makeRotateMatrix() function. How can I control the camera view using this matrixes....?(moving camera's sight) I'm getting hard time because of this... please help me..... ;( And

Matrix Palette, Drawing Issue when ModelView Matrix

只愿长相守 提交于 2019-12-13 01:14:54
问题 Using OpenGL 1.1 and the Matrix Palette extension. The issue I'm having, is that not every model being loaded needs to be animated, so I don't think that I need to enable those client states nor provide weights or weight index arrays. For example, I'm trying something like this during my drawing code... glMatrixMode(GL_MATRIX_PALETTE_OES); glBindBuffer(GL_ARRAY_BUFFER, dataBuffers[0]); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, dataBuffers[1]); glEnableClientState(GL_VERTEX_ARRAY);

GLSL Shader - Coverflow Reflection of a 2D object

百般思念 提交于 2019-12-13 00:04:12
问题 I want to write a shader that creates a reflection of an image similiar to the ones used for coverflows. // Vertex Shader uniform highp mat4 u_modelViewMatrix; uniform highp mat4 u_projectionMatrix; attribute highp vec4 a_position; attribute lowp vec4 a_color; attribute highp vec2 a_texcoord; varying lowp vec4 v_color; varying highp vec2 v_texCoord; mat4 rot = mat4( -1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ); void main() { gl_Position = (u

Android texture only showing solid color

偶尔善良 提交于 2019-12-12 21:17:06
问题 I am trying to display a single texture on a quad. I had a working VertexObject, which drew a square(or any geometric object) fine. Now I tried expanding it to handle textures too, and the textures doesn't work. I only see the quad in one solid color. The coordinate data is in an arrayList: /*the vertices' coordinates*/ public int coordCount = 0; /*float array of 3(x,y,z)*/ public ArrayList<Float> coordList = new ArrayList<Float>(coordCount); /*the coordinates' indexes(if used)*/ /*maximum

Fish Eye Effect With Core Animation?

偶尔善良 提交于 2019-12-12 21:16:03
问题 I am trying to achieve an effect similar to the globe of the ABC News iPad app. (Google Images Examples) Is it possible to get this effect by transforming CALayers? Or is this using OpenGL and fragment/vertex shaders? CALayer provides access to the transformation matrix, is there some math that can be applied to this rather than transforming the OGL model view matrix? Feels like OGL is the more complicated way to do this and that there should be an easier solution. If anyone has some ideas it

Translation to world coordinates

你说的曾经没有我的故事 提交于 2019-12-12 21:16:02
问题 I have mouse coordinates: mousePos , a matrix view view , and a perspective projection matrix pMatrix . I translate the coordinates into the world: I find the inverse projection matrix and the inverse matrix view and multiply by the coordinates of the mouse. The coordinates of the origin is z = 4 , the coordinates of the end is z = -100 . In the first case, I get the coordinates mouseDir1 = (-0.1985 0.02887 4) , and in the second case mouseDir2 = (-0.1985 0.02887 -100) . Why are the

How to map 2D display coordinate to 3D OpenGL space

谁说胖子不能爱 提交于 2019-12-12 21:09:19
问题 I am working on a 3D game that is ported on Android and I want to work with touch events in 3D course of a game. I need point in 3D space, right on near clipping plane, but all I can get is a 2D coordinates from an Android display. So, is there any way to map these (x, y) coordinates to (x, y, z) coordinates in 3D space? EDIT Well, I am working on a racing game, and I want to insert some items on a course, depending on where I click. I have this function: void racing_mouse_cb(int button, int

Using texture image with alpha makes mesh 'see through'

孤者浪人 提交于 2019-12-12 20:08:48
问题 I am rendering an obj file in OpenGL ES 2.0 on Android with Back-Culling enabled. Only some part (the necklace around the neck) of the texture image actually has alpha. When rendering only the mesh, it looks fine : However, on enabling the texture, I am able to see through the mesh onto the other side. You can see below that the right hand which is behind the body also becomes visible. Any ideas what might be going wrong ? Edit: I have tried the following : Enabling/Disabling back face