views:

46

answers:

1

Hi.. I have designed a 3D model in .obj format and imported using min3d framework. Its a cube with different colors. I want to give a Toast with a message for a particular color when the side of that particular color is touched. How do I do this in android 1.6 ?

A: 

I'm not sure about the particulars in android/OpenGL-es, but in general:

You have to calculate a line that starts at the camera's position and passes through the screen coordinate pressed/clicked/etc and determine where that line intersects your object.

It's called... ah yes: "picking". Googling for "opengl picking" turned up a tutorial or three:

http://www.lighthouse3d.com/opengl/picking/

http://gpwiki.org/index.php/OpenGL:Tutorials:Picking ...

I just googled "opengl picking". Those two are the first two links, the next is a FAQ entry, followed by another tutorial. You get the idea.

Once you know what its called, finding information gets much easier. Good hunting.

Mark Storer