Code Monkey home page Code Monkey logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
We never did implement a feature that would identify objects from a click. I do 
have a test build somewhere that did something like that, though. I'll see if I 
can find it.

Original comment by [email protected] on 23 Jan 2012 at 3:36

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
that would be really really great.
i'm really lost right now. I can catch the MotionEvent without a problem, also 
getting the AstronomerModel and the Pointing (which includes the line of sight) 
is not a problem.

But from here i'm lost. How to convert the screen coordinates of the 
MotionEvent to GeocentricCoordinates? And when i have those, how to find the 
object that is at that location?

Greets

Original comment by [email protected] on 23 Jan 2012 at 3:44

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
I must have deleted the code because I couldn't find it.

For converting screen coordinates, I think I basically did linear 
interpolation. If you know the coordinates of the four corners of the screen, 
you can interpolate the location of the event. Note that this breaks down at 
the corners. It is also a pretty bad assumption if you are zoomed way out. It 
should be good enough for experiments, though.

For the search, I think you can do a linear search. We should have all of the 
coordinates of objects in memory. I would simply compare the coordinates of the 
event with the coordinates of each object and return the closest one. If you 
follow the logic for searches, you should find the right data structures. I 
realize that its inefficient, but again, it should be good enough for now.

Its been a while since I looked at that code, so I can't give you any concrete 
references. I'll try to poke around in the code over the next couple of days 
and send more concrete suggestions.

Original comment by [email protected] on 24 Jan 2012 at 12:27

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
You may also want to pop up a list of nearby objects if the area is crowded.  
That's what I do in LunarMap for Android and AstroInfo for Palm.  

Original comment by arpruss on 24 Jan 2012 at 1:24

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
The approach with the linear interpolation using the edges of the "visibly sky" 
is a great idea.
But how do i get those four edges? Are there any helper functions present for 
that?

Original comment by [email protected] on 24 Jan 2012 at 2:05

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
Kevin if you do happen to find that code or know of any good resources to get 
other started on re-inventing it that would be appreciated.

As I mentioned elsewhere I'm trying to get something going to take advantage of 
Starmap and Skywatcher's Panorama app both being open source, being able to 
click on an object on screen to select the object for further action (such as 
slewing a telescope to it) would be a very hand addition.

Bob

Original comment by [email protected] on 22 Apr 2012 at 9:07

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
Realised that I'd not done enough with google prior to that last question. 
Sorry about that. I'll do some more homework and may then need to ask some more 
questions.

Bob

Original comment by [email protected] on 22 Apr 2012 at 11:24

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
There's been any develop on this? I'm trying to do the same, but I'm completely 
lost...

Original comment by [email protected] on 2 Dec 2014 at 10:30

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
[deleted comment]

from stardroid.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 14, 2024
Ok, so here's what I've done.

I captured the labels Geocentric Positions and stored all of them in the 
ApplicationConstants class. You can get them in the 
ProtobufAstronomicalSource.getLabels(), except for the planets, wich you can 
get on PlanetSource.initialize().

Then, when the user clicks, the method onSingleTapConfirmed is called in the 
class com.google.android.stardroid.touch.GestureInterpreter. Inside this method 
I get all the labels, convert the Geocentric Postions into screen position, 
using this code attached.

I hope this helps.
Marcio Granzotto Rodrigues

Original comment by [email protected] on 6 Jan 2015 at 8:14

Attachments:

from stardroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.