Per Pixel collision
Hi.
I'm currently developing an iPhone game, I need some help to implement the collision detection.
The basic idea is that I have a large han drawn map, tha player should be able to move in all the black regions of it. In OpenGL I obtained that by performing a 1:1 check between the player 32x32 texture and a 32x32 portion of the map texture(the portion where tha player is on obviously).
I used the glGetTexImage and glReadPixels methods to do this, but now in OGL ES there's no glGenTexImage and the ReadPixel is too slow for an handheld device.
Is there a better way to perform per pixel collision checks? I only need a true/false check.
Any ideas?
Thanks
I'm currently developing an iPhone game, I need some help to implement the collision detection.
The basic idea is that I have a large han drawn map, tha player should be able to move in all the black regions of it. In OpenGL I obtained that by performing a 1:1 check between the player 32x32 texture and a 32x32 portion of the map texture(the portion where tha player is on obviously).
I used the glGetTexImage and glReadPixels methods to do this, but now in OGL ES there's no glGenTexImage and the ReadPixel is too slow for an handheld device.
Is there a better way to perform per pixel collision checks? I only need a true/false check.
Any ideas?
Thanks
If you have the raw image data for the player and for the map in memory, it should be easy enough to check the pixels manually based on the player's position.
The map might be quite large, I don't want to waste too much memory
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| [Problem] Loading image with OpenGL orthogonal view pixel-to-pixel | Lexis | 2 | 3,214 |
Aug 21, 2009 01:35 AM Last Post: Lexis |
|

