GithubHelp home page GithubHelp logo

get ra and dec of clicked body about virtualsky HOT 8 CLOSED

slowe avatar slowe commented on August 15, 2024
get ra and dec of clicked body

from virtualsky.

Comments (8)

astroanu avatar astroanu commented on August 15, 2024

anybody?

from virtualsky.

slowe avatar slowe commented on August 15, 2024

Sorry. I've been cycling from Liverpool to Istanbul for the past two months. I'm not really sure what you mean by "clicked body"? Could you provide a little more context? Thanks.

from virtualsky.

astroanu avatar astroanu commented on August 15, 2024

Oh.. long long journey

By 'body' i meant celestial body (a star or a planet). I want to get the ra and dec values and may be other info regarding the body when the user clicks on it.

from virtualsky.

slowe avatar slowe commented on August 15, 2024

Not without quite a bit of work is the simple answer. The 'stars' and 'planets' you see on the screen are drawn pixels. There isn't currently a lookup mechanism to go backwards from pixel position to object.

from virtualsky.

astroanu avatar astroanu commented on August 15, 2024

oh i see. it's because of the canvas ? If you are planning on something like that it would be really nice/. this is a really good plugin. 🤘

from virtualsky.

pludov avatar pludov commented on August 15, 2024

I am in need for this feature ! Are you actively working on it ?

For now, I worded out finding the ra,dec coordinates from mouse/touch coordinates for all projections. I'll open a PR once it's cleaned up

from virtualsky.

slowe avatar slowe commented on August 15, 2024

There is now a click callback which can be used e.g.

'callback': {
	'click': function(e){
		// The event includes e.x, e.y, e.ra, e.dec.
		// Get the nearest object based on the x/y cursor position
		e.nearest = e.data.sky.nearestObject(e.x,e.y);
		console.log(e.nearest);
	}
}

from virtualsky.

pludov avatar pludov commented on August 15, 2024

Long press is probably broken :
a43ab23#r34608949

from virtualsky.

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.