PDA

View Full Version : Selection 3d objects OpenGL ES 1.x



lacasrac
03-14-2012, 03:29 AM
How can I select an object in a world?

color picking is not working, the device sadly come with incorrct datas.

How can I do ray cast to do that?

Thanks

gardin
04-20-2012, 12:45 PM
Why is the device giving you incorrect data?

There are some state changes you should do to make sure you get the exact correct color values when doing picking:

http://www.opengl.org/archives/resource ... r.htm#0040 (http://www.opengl.org/archives/resources/faq/technical/color.htm#0040)

GL_DITHER is for example something that is easy to forget.

If that did not work, im afraid you have to implement something on the CPU-side, such as encapsule your objects in spheres, AABBs or OBBs and then do some raytracing, or do it directly with the triangles if you need perfect matches