opengl-es

Are there open source implementations of Wavefront OBJ loaders for the iPhone?

I would like to display 3-D models of building interiors in my iPhone application, but they are in Wavefront OBJ format. Is there an open source implementation of a Wavefront OBJ loader that I could use within my application? ...

OpenGL ES render textures of non base 2 dimensions?

This is just a quick question before I dive deeper into converting my current rendering system to openGL. I heard that textures needed to be in base2 sizes in order to be stored for rendering. Is this true? My application is very tight on memory, but most of the bitmaps are not a perfect square. Does storing non-base 2 textures waste e...

How to print 3d string in android

Please help me, now I am developing a screen saver by let the user input the string and I will bring this string to print out as a 3d string on the android mobile phone. Please suggest me in the android have function to do this or I have to use openGL ES to develop and how to do that. ...

How would you call a method from all instances of a class?

I am writing a basic game engine and have an abstract class that represents any object that can be drawn in the 3D world, however inside this class is an abstract method Render() which I would like called automatically by the engine on each draw phase. How could I implement this so that every class extending from my abstract class will a...

Mipmapping in a scalable view similar to google maps?

I have a huge map image (8192x6144px) which I'd like to display at scales ranging from 1x to 0.1x. At 1x this is about 24 mb using PVR 4-bpp compression--a little too much. So I'd like to load them at varying resolutions, depending on the map scale. Does mipmapping accomplish what I need, which is to load/unload levels of mipmaps based...

OpenGL ES 2 - load and display image

Hi guys, I'm having trouble finding any examples of OpenGL ES 2 (C++) loading/displaying images. Been looking for last 3 hours but all I found so far is for iPhone or "Look Ma! A triangle!" or it's unbelievably complicated (at least for me). I'm just looking for something super easy (for a not very smart person). All I need is to load ...

Android OpenGL ES - I can't make gluLookAt/gluPerspective work

Hi everybody, the following text is a bit lenghty as I wanted to make sure that people with similar problems that e.g. google this page can easily follow the exact problem and its solutions easily. But now on to my issue: I recently started programming OpenGL ES on an Android smartphone and ran into problems understanding how gluPerspe...

How to overlay GLSurfaceView over a CameraPreview in Android?

I am trying to merge two examples from the ApiDemos so one overlay over the other. 1. CameraPreview.java 2. TranslucentGLSurfaceViewActivity.java I guess GLSurfaceView is not really necessary, I saw demos that uses a GL layer as a Camera PreviewCallback, but since I am such a noob at OpenGL, I am kind of lost. Can someone points me towa...

Implement iphone MSAA using Unity build

I want to implement MSAA into the Unity build of a game. Currently I am using this code I got from the Unity forums and it compiles but I can clearly see that it is having no effect in game. Any help would be appreciated. bool msaaEnabled = false; CGSize globalSize; struct MyEAGLSurface { GLuint format; GLuint depth...

Spinning globe in Opengl-es

I need to draw a spinning globe using opengl es in android. I think we need to draw a sphere and then apply a texture map on it. If I am correct, we cannot use the utility library glu in Opengl ES for drawing a sphere. I did find some code in objective C, but then I would have to make it work on android. http://www.iphone4gnew.com/proc...

How can I develop 2D bmp to 3D Ball

I develop a 2D to 3D android application. but It will not work Anyway I've used this library import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.opengl.GLSurfaceView; import an...

Android - Draw 3D then 2D with openGL ES

How can i draw a HUD (Text or Bitmaps) after drawing some 3d stuff in openGL ES ?? I tried this: private void switchTo2D(GL10 gl){ gl.glDisable(GL10.GL_DEPTH_TEST); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); gl.glMatrixMode( GL10.GL_PROJECTION ); gl.glLoadIde...

Android calling GLUtils.texImage2D within onDrawFrame very slow...

We are building a scrollable background, and currently have one large background image that we split up into 512x512 tiles, and want to load these tiles as they are needed, instead of all at once, when calling GLUtils.texImage2D within onDrawFrame, we have noticeable lag we think because of having to load the texture onto the hardware, i...

OpenGL ES on iPhone, How to Optimize for 2D (+ questions)

Hello ! I begin with OpenGL (and ES), so I have some (|| a lot) of troubles ^^ I Have two questions. 1°) I would like to have your opinion about my code. Because I don't know if all lines doing what they should do. The aim is to draw the lines of a polygon (but not to fill it, yet ^^). So I just want to do 2D on background transparent....

Problems rotating a sprite using drawtexture (OpenGl ES Android)

Hi guys! I´m trying to rotate a sprite using drawtexture but nothing happens. I´m using the following code: gl.glRotatef(90, 0, 0, 1.0f); gl.glBindTexture(GL10.GL_TEXTURE_2D, TextureID); (GL11Ext) gl).glDrawTexfOES(x, y, z, width, height); The texture is drawn to the screen but it is not rotated... Anyone? :) ...

Fish Eye Effect With Core Animation?

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 transf...

OpenGL gradient fill on iPhone looks striped

Hi! When I draw a gradient fill with OpenGL, the output looks striped, i.e. it's rendered with only about the a fourth of the possible colors. In the render buffer all the colors appear but not in the actual output. I'm developing on iPhone 3G running iOS4. Any ideas? Peter ========== ========== GLint redBits, greenBits, blueBi...

OpenGL ES render bitmap glyph as texture positioning issues

I'm just testing this stuff out, so I don't need an alternate approach (no GL extensions). Just hoping someone sees an obvious mistake in my usage of GLES. I want to take an bitmap of a glyph that is smaller than 32x32 (width and height are not necessarily powers of 2) and put it into a texture so I can render it. I've first created an ...

Training sessions: Android graphics

Hello there, Can anyone please recommend a training session/course for Android graphics API/OpenGL ES? Thank you! ...

Alpha blending with OpenGL ES 2.0?

What's the best way? I tried to do this naïvely with a fragment shader that looks like this: varying lowp vec4 color; void main() { lowp vec4 alpha = colorVarying.wwww; const lowp vec4 one = vec4(1.0, 1.0, 1.0, 1.0); lowp vec4 oneMinusAlpha = one-alpha; gl_FragColor = gl_FragColor*oneMinusAlpha + colorVarying*alpha; ...