Like TreKing already explained, if you take your phone, "look through" it at
the world around you, and pick a point on the screen - then that defines a
ray (line in 3d) that starts at your eyes, passes through the point on the
screen that you touched, and stretches into the infinity.

You can find math for that on the web - it's called unprojecting.

The next step is figuring out what this ray hits (if anything) before
disappearing into the sky. This is application-specific, and you'll need to
come up with your own way of storing and retrieving data (about buildings,
for example) and implement intersection tests between the ray and the
buildings.

-- Kostya

2011/1/18 prachi <[email protected]>

> I generally use location.distancebetween method to calculate the
> distance taking my camera position as the origin.
>
> But here my actual requirement is to fetch lattitude and longitude
> values from screen coordinates.So for this i need world x,y,z values.
>
> Again any idea about it?
>
> On Jan 17, 6:48 pm, TreKing <[email protected]> wrote:
> > On Mon, Jan 17, 2011 at 5:54 AM, prachi <[email protected]> wrote:
> > > I have the screen x,y value and i need to fetch the corresponding world
> > > coordinates(x,y,z) for the same.
> >
> > Technically speaking, there is no "corresponding" [X, Y, Z] for a given
> [X,
> > Y]. Converted to 3D, a 2D point becomes a line with an infinite number of
> > points along Z. However, you can find a particular Z given some more
> > restrictions (like an origin and a distance). Google around for "3D
> > projection" and "3D picking" - this is of itself not an Android-exclusive
> > concept.
> >
> > > Ny idea how to do dis???
> >
> > They're spelled "any" and "this", respectively. You'll be taken far more
> > seriously if you take time to proofread your posts.
> >
> >
> ---------------------------------------------------------------------------­----------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
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

Reply via email to