Tim Omernick from ngmoco recently gave a talk at Stanford and demonstrated an interesting fireworks app for the iPhone that he posted up the code for here:
gamemakers.ngmoco.com/post/111712416/stanford-university-and-apple-were-kind-enough-to
I can get the app to run when I specify the EAGLView's parent class as a UIView in its header ...
I'm using OpenGL ES to draw things in my iPhone game. Sometimes I like to change the alpha of the textures I'm drawing. Here is the (working) code I use. What, if anything, in this code sample is unnecessary? Thanks!
// draw texture with alpha "myAlpha"
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE,GL_COMBINE );
glTexEnvf(GL_T...
How can I efficently interpolate per-pixel two textures A and B by a dynamic texture C and draw them on a simple quad? Multi-pass algorithms accepted.
I've had moderate success calculating the C texture per-frame on the CPU and uploading it with glTexImage2D into an alpha-only texture.
While this worked, performance was lacking and I h...
Hi.
I have a quick question: I am loading a mp3 file into a NSData object and then I play it using the AVAudioPlayer in my game. Every second or so, the frame rate drops and you can see a stuttering on the screen. It is not a major slowdown, but clearly noticeable and disrupting to the gameplay. Not playing the music track with the AVAu...
I like the convenience of NSMutableArray but sometimes you just need to drop down to good ole C-arrays. Like when you are feeding interleaved vertex arrays to OpenGL.
What is the fastest way of copying the contents of an NSMutableArray to a C-array?
Yah, I realize this bit shuffling introduces inefficiency but I'd like to see if I can...
I have been unable to find a way to anti-alias my rendering on iPhone OS 3.0 + OpenGL ES 2.0. I had assumed there would be multisampling but that appears to not be the case. I've been told that fragment shaders can be made aware of the projected pixel via a partial derivatives extention but I have no idea where that functionality lives o...
I have been having trouble finding straightforward code to render a scene to a texture in OpenGL ES (specifically for the iPhone, if that matters). I am interested in knowing the following:
How do you render a scene to a texture in OpenGL ES?
What parameters must you use to create a texture that is capable of being a render target in ...
I did not find a good definition of the concept of a drawing surface. What properties are associated with a surface? In the context of pure OpenGL there is no surface, since OpenGL has no notion of window system specific things. In OpenGL ES though you have the EGL API, which introduces the concept of a drawing surface, without defining ...
I would like to find an iPhone OpenGL ES Example that responds to touch.
Ideally it would meet these requirements:
Displays a 3D object in the center of the screen like a cube
Maps a texture to the cube surfaces
Should move the camera around the cube as you drag your finger
Should zoom the camera in and out on the cube by pinching
Opt...
I have a Windows Mobile 5 application that uses OpenGL ES 1.1. It works on Windows Mobile phones (5, 6 and 6.1), but I can't seem to get it working in the emulator.
I've tried downloading Vincent (SW OpenGL ES library) and placing its DLL with my application, but that didn't work. Any suggestions?
EDIT: The problem only happens when I ...
I've tried using pngs with gradients as textures in my OpenGL ES based iPhone game. The gradients are not drawn correctly. How can I fix this?
By "not drawn correctly" I mean the gradients are not smooth and seem to degrade to sections of a particular color rather a smooth transition.
...
How do you draw a cylinder with OpenGLES?
...
I created a simple 3D model in Blender, and imported this into OpenGLES for the iPhone SDK. The model imported with no problems for the most part but as you can see from the included photo links (photobucket), OpenGL is stretching the model beyond its intended proportions. The circular cylinders are made ovular, the squat rectangular bod...
I apologize in advance if this question seems confused. The behaviour I am seeing makes no sense to me.
I have a Framebuffer rendering to a texture. I render solid rectangles of red, green, blue of varying opacity to this texture. I then render the texture to the screen (Framebuffer 0). The Framebuffer attached to the texture is persist...
I have a large texture atlas and I'm drawing lots of textures on the screen from this. At the moment each texture from the atlas is drawn separately with code like this:
GLfloat coordinates[] = {
bla, bla,
bla, bla,
bla, bla,
bla, bla
};
GLfloat vertices[] = {
bla, bla, bla,
bla, bla, bl...
The Screen-to-world problem on the iPhone
I have a 3D model (CUBE) rendered in an EAGLView and I want to be able to detect when I am touching the center of a given face (From any orientation angle) of the cube. Sounds pretty easy but it is not...
The problem:
How do I accurately relate screen-coordinates (touch point) to world-coo...
Hello everybody!
I am beginning to work on my first OpenGL iPhone app, but I've hit an early snag.
I have a VERY SIMPLE little texture that I want to use as a sprite in a 2D game, but it renders with weird 'randomly' colored pixels up top.
http://i40.tinypic.com/2s7c9ro.png <-- Screenshot here
I sort of get the feeling that this is P...
There are a few posts on this site about OpenGL and the iPhone. Some even on books but I think you'll find this question is a bit different.
I've searched and searched and have come to the conclusion that there are currently no books that specifically cover OpenGL ES on the iPhone platform. There are books that cover OpenGL ES [2.0] (n...
I am trying to rotate a 3D model in both forward (counter-clockwise) and reverse (clockwise) rotation directions in orthographic mode. glRotatef() automatically executes a forward rotation but I cannot get a reverse rotation. I have tried the following methods and none of them give me results:
//(Provide a negative rotation angle of ...
I want to program a board game (similar to checkers) for the iPhone. Would OpenGL ES or CoreGraphics be a better option? What do most games of this type on the App Store use?
...