Open gles 2.0 object collision


I am new to opengl es.

I am using opengles 2.0 with android. I want to find programmatically how to find if the two 3D objects have intersected or collided at some place ?

Can someone please help me with this ?


do your objects are moving? can you show your o/p?

You can try by checking color values at particular point on the surface.

No my objects do not move.

In some instances they appear on the scene if they are in overlapping each other where as in some scenarios they do not overlap.

How can checking color values help ? Can you please explain in more detail ?

Draw a sphere around your object. Lets say 2 objects with 2 spheres, radii r1 r2, now calculate a distance between two centres of circle. If distance is less than r1+r2 then you have collision.

  1. Are there FRONT_RIGHT, FRONT_LEFT, BACK_RIGHT, and BACK_LEFT buffers or just FRONT and BACK buffers?

only FRONT and BACK buffers. you can specify in eglCreateSurface()

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.