Jump to content
• Advertisement

# [CLOSED]Sun, moon position: RA dec to XYZ

This topic is 3906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hello! I want to develop a realistic looking earth-viewed sky from a 3D plane (earth). I can have (RA, dec) coordinates for the sun and for the moon at a certain date and I want to position them in the skydome accordingly. I can convert those coords from spherical to cartesian using something like: sunPosition = new Vector(dist * Math.cos(-AR)), dist * Math.cos(-DC) * Math.sin(-AR), dist * Math.sin(-DC) * Math.sin(-AR)) This is like saying the earth is going around the sun, as the sun appears circling in the sky being top on june and bottom on december, growing east and falling west. But what if I want to put it in the right place by the right hour of the day? I need to consider earth rotation on its axis, I guess... Has anyone dealt with this before? Thanks for any suggestions. [Edited by - Adriano on February 12, 2008 6:30:34 AM]

#### Share this post

##### Share on other sites
Advertisement
As reported in this gamedev post:

http://www.gamedev.net/community/forums/topic.asp?topic_id=100346&PageSize=25&WhichPage=2

This was the solution to my problem:

http://graphics.ucsd.edu/~henrik/papers/nightsky/nightsky.pdf

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19
• Advertisement

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632999
• Total Posts
3009812
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!