We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Mapping points on a sphere
Page Index Toggle Pages: 1
Mapping points on a sphere (Read 759 times)
Mapping points on a sphere
Oct 28th, 2008, 10:31am
 
I am trying to write a planetarium software and I want to be able to map the positions of stars onto a sphere. The view would be based at the centre of the invisible sphere and stars would be mapped onto the relevant position on the sphere using their Right Ascension and Declination co-ordinates. I then want to be able to roll that sphere around and see the stars and constellations move around.

Can anyone help with how I may go about doing this please?
Re: Mapping points on a sphere
Reply #1 - Oct 29th, 2008, 11:40am
 
it looks like right ascension and declination are just spherical polar coordinates and should be easy enough to work out.

examples and how to translate angles to x,y,z on wikipedia. your radius will always be the same if the points are on a sphere:
http://en.wikipedia.org/wiki/Spherical_coordinates

(you'll probably need to translate the origin to the centre of the screen first)

as for rolling around, just have some global parameters and rotateX(x), rotateY(y), rotateZ(z) before drawing.

(oh, and please don't post in other threads just because you don't get any answers in this one.)
Re: Mapping points on a sphere
Reply #2 - Oct 30th, 2008, 9:17am
 
Koogs, I posted it in the other thread as I realised other people were possting stuff about their code there rather than here. If there was a way to delete posts I would have done so.

Thanks for the information it was very helpful. Using it I have now managed to get a camera centred in an imaginary sphere looking at a starfield mapped in the field of view using RA and DEC co-ordinates. With the information you priovded it was actually pretty easy to do in only a few lines of code. Thanks.
Re: Mapping points on a sphere
Reply #3 - Oct 30th, 2008, 11:05am
 
(i think the main objection to double posting is that it scatters the answers to questions and make searching harder. and 'programs' makes more sense that 'syntax' for this thing.)

i'd be interesting in seeing what you have if it's on the web anywhere. i nearly tried writing a little something myself but there were zombies on the telly 8)

there is some great open source planetarium software out there if you haven't seen it - celestia, kstars, stellarium...

Re: Mapping points on a sphere
Reply #4 - Oct 30th, 2008, 12:28pm
 
I already have Stellarium and Celesta which are great Freeware programs. I also have commercials oftware like Starry Night and The SKy.

However, I want to create a planetarium software that is also a teaaching aid to learn the night sky. This will show a starmap and will do things like make a constellation invisible and get the user to name the missing constellation or to show a circle where a Messier Object should go and getting the user to name the unknown object, etc.

Now I know how to map points in 3D space that relate to the RA and DEC co-ordinates of sky objects that should be (relatively) easy to do.
Page Index Toggle Pages: 1