我已经设计了.OBJ格式的3D模型,并使用min3d框架进口。它用不同颜色的立方体。我想给一个消息,并为吐司特定颜色时特定颜色的侧感动。如何在Android 1.6的做到这一点?
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 ?
推荐答案
我不知道有关细节的Android / OpenGL的ES,但一般的:
I'm not sure about the particulars in android/OpenGL-es, but in general:
您必须计算开始于摄像机的位置,并通过屏幕坐标pressed线/点击/等,并确定这条线相交的对象。
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.
这就是所谓的...是啊是:采摘。对于谷歌搜索的OpenGL采摘翻了一个教程或三:
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 ...
我只是用Google搜索OpenGL的采摘。这两个是前两个环节,接下来就是一个FAQ条目,紧接着又教程。你的想法。
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.
相关推荐
最新文章