Hi Boston, I failed with both GLU.gluUnProject or your gluUnProject. Maybe there is something wrong with my polygon coordinates. In fact, the polygon is just a square, which is the face of a small cube. I get the coordinates from GLWord.mVertexBuffer(such as mVertexBuffer.get(0)/ 65536.0), is this coordinates the same kind with that which I got from gluUnProject? Are they both belongs to object coordinates?
On Jun 19, 12:21 am, Streets Of Boston <[email protected]> wrote: > Yes, you are on the right track. :-) > However, i could not get gluUnProject to work. I wrote my own: > http://groups.google.com/group/android-developers/browse_frm/thread/9... > (see messages no. 6 and 8) > > On Jun 18, 4:21 am, quill <[email protected]> wrote: > > > > > Thank you Nightwolf. > > I want to choose the Kube when I touch on the Kube face in order to > > rotate Kube. > > My idea is: > > 1. to get vertices of Kube to compose a polygon(2D); > > 2. judge if the touch point locates in the polygon; > > As you said, the cube coordinates is not modified, so I use > > gluunproject() to change touch point coordinates(x, y, 0) in order to > > map window coordinates to object coordinates, and then I judged if the > > new touch point coordinates locates in the polygon. Am I on the right > > way? > > > On Jun 18, 11:59 am, Nightwolf <[email protected]> wrote: > > > > Cube coordinates are stored in vertices array in Cube.java. > > > Rotating effect is achieved via model view matrix modification > > > (glTranslate and glRotate commands). Original vertex data isn't > > > modified. > > > > On Jun 17, 8:30 pm, quill <[email protected]> wrote: > > > > > Hi all, > > > > I'm modifying Kube(api demo) to a game, does anyone who know how to > > > > get the vertice coodinates of Kube? From the source code in api demo, > > > > I think GLWorld.mVertexBuffer may save the vertice coodinates after > > > > rotate the Kube, but I was wrong, the infomation in mVertexBuffer > > > > always remains the same.- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

