Looking for best way of animating the Moon

J

Jason Brown

I've got this big Moon graphic. It takes up all the page. Now I want to
make it look like the phases of the Moon, maybe with an overlay to
simulate the shadows. Ideally the shadow would move in realtime, or
failing that, updated as often as possible to reflect what the Moon is
really doing.

I'm trying to work out what the best way of doing this would be. Could
the shadow effects be mapped with with css and layers? I'd like the
Moon graphic to show through, so some kind of transparancy effect.

I suppose one option is to make all the images of the phases and load
them into the page at given times of the day, using a script.

Jason
 
N

Neredbojias

With neither quill nor qualm, Jason Brown quothed:
I've got this big Moon graphic. It takes up all the page. Now I want to
make it look like the phases of the Moon, maybe with an overlay to
simulate the shadows. Ideally the shadow would move in realtime, or
failing that, updated as often as possible to reflect what the Moon is
really doing.

I'm trying to work out what the best way of doing this would be. Could
the shadow effects be mapped with with css and layers? I'd like the
Moon graphic to show through, so some kind of transparancy effect.

I suppose one option is to make all the images of the phases and load
them into the page at given times of the day, using a script.

- In realtime with what, the actual moon?

- What "shadow effects"? Do you mean you want a full moon image
overlaid with translucencies? Not the way to go, methinks.

- Yes, per your last sentence, use separate images. However, you'll
need only one per day at most to show the proper phase, won't you?

I'm not quite sure how you could synchronize the simulated event with
the real one long-term since I'm not an expert at mooning, but I'll bet
it could be done.
 
S

smokeyd

If you can use Macromedia Flash. Animate the moon with Actionscript to
determine the time of day. I think this would be the best way to get
the moon moving in real time.
 
N

Neredbojias

With neither quill nor qualm, smokeyd quothed:
If you can use Macromedia Flash. Animate the moon with Actionscript to
determine the time of day. I think this would be the best way to get
the moon moving in real time.

What the heck has the time of day to do with it?
 
S

smokeyd

Neredbojias said:
With neither quill nor qualm, smokeyd quothed:


What the heck has the time of day to do with it?
To get the moon to animate in real time, you will have to retrieve the
current time at some point.. unless you know some other way to do it
clever-cloggs?
 
D

Dylan Parry

Using a pointed stick and pebbles, smokeyd scraped:
To get the moon to animate in real time, you will have to retrieve the
current time at some point.. unless you know some other way to do it
clever-cloggs?

Well yes, the phase of the moon does change over time, but you only need
to calculate the day in the cycle (29 days?) not the actual time here on
Earth.

--
Dylan Parry
http://webpageworkshop.co.uk -- FREE Web tutorials and references

"When I was kidnapped, my parents snapped into action. They rented out
my room" - Woody Allen
 
P

Philip Ronan

It would be a better idea to prepare a complete set of images to represent
the appearance of the moon on each day, and use a server-side script to
select the closest match when a page is requested.

Just about any 3D application will be able to generate these images for you,
and you can use a server-side language like PHP to insert the name of the
picture representing the current phase. The maths is very simple.

That way you don't have to rely on visitors having flash or javascript
available in their browsers.
 
S

smokeyd

Dylan said:
Using a pointed stick and pebbles, smokeyd scraped:


Well yes, the phase of the moon does change over time, but you only need
to calculate the day in the cycle (29 days?) not the actual time here on
Earth.

--
Dylan Parry
http://webpageworkshop.co.uk -- FREE Web tutorials and references

"When I was kidnapped, my parents snapped into action. They rented out
my room" - Woody Allen

Yes you are both very clever.. so am I missing something or where have
you actually been any help in this post? Or do you just spend your
days trawling posts trying to be funny? Get a life you sad b@stards!
 
D

Dylan Parry

Using a pointed stick and pebbles, smokeyd scraped:
Yes you are both very clever.. so am I missing something or where have
you actually been any help in this post? Or do you just spend your
days trawling posts trying to be funny? Get a life you sad b@stards!

What was funny in my post? Or rather, where did I /try/ to be funny?

I offered advice, stating that it is the moon cycle period that you need
to calculate, not the time of the day. The OP would need to create a
script that gets the day in the phase where 29 is the maximum value of
days, and represents a new moon (as does 0).

It might even be possible to have a cron tab open a text file that
contains a number (/x/) and adds 1 to /x/ at midnight of each day, but
resets /x/ back to zero on the 29th day. This file will then contain a
number that represents the image to use for each day within the cycle.

The only thing that the OP would need to know is *which* day of the
cycle the moon is in when they create the initial file and set the value
of /x/ to be that day to start with.

If you cannot see that as helpful advice then you are more of an idiot
than you come across. This is Usenet, not your personal help desk. Do
not expect questions to be answered without discussion. If you don't
like it then sod off elsewhere.
 
S

smokeyd

"Using a pointed stick and pebbles, smokeyd scraped: "

could maybe have been put more politely and with less typing as:
'smokeyd wrote:'

"What the heck has the time of day to do with it? "

could maybe have been written have been written a bit more politely as
well?

Anyway your last post was actually of some use and I take your point
about the Usenet so peace? I take back the b@stard comment as well was
just having a bad day yesterday. Any chance of helping finding the
solution to my stlesheet problem?
 
S

smokeyd

"Using a pointed stick and pebbles, smokeyd scraped: "

could maybe have been put more politely and with less typing as:
'smokeyd wrote:'

"What the heck has the time of day to do with it? "

could maybe have been written have been written a bit more politely as
well?

Anyway your last post was actually of some use and I take your point
about the Usenet so peace? I take back the b@stard comment as well was
just having a bad day yesterday. Any chance of helping finding the
solution to my stlesheet problem?
 
D

Dylan Parry

Using a pointed stick and pebbles, smokeyd scraped:
"Using a pointed stick and pebbles, smokeyd scraped: "

could maybe have been put more politely and with less typing as:
'smokeyd wrote:'

It's not something I type, but something that my Usenet client puts in
automatically. I customised it, as do many folk here, to something
(slightly) humorous.
"What the heck has the time of day to do with it? "

could maybe have been written have been written a bit more politely
as well?

Well that one I can't apologise for as it wasn't me who said it ;)
Anyway your last post was actually of some use and I take your point
about the Usenet so peace? I take back the b@stard comment as well
was just having a bad day yesterday.

That's understandable. I'm having a bad day today too! :)
Any chance of helping finding the solution to my stlesheet problem?

What problem might that be? The CSS border problems? Well, I can't help
there I'm afraid as I can only think of a solution that requires a
slight change to the HTML, but as you said, you can't change the HTML
output from the CMS, so that puts a stop to my idea! :(
 
S

smokeyd

Using a pointed stick and pebbles, Dylan Parry scraped:
Using a pointed stick and pebbles, smokeyd scraped:


It's not something I type, but something that my Usenet client puts in
automatically. I customised it, as do many folk here, to something
(slightly) humorous.


Well that one I can't apologise for as it wasn't me who said it ;)


That's understandable. I'm having a bad day today too! :)


What problem might that be? The CSS border problems? Well, I can't help
there I'm afraid as I can only think of a solution that requires a
slight change to the HTML, but as you said, you can't change the HTML
output from the CMS, so that puts a stop to my idea! :(

--
Dylan Parry
http://electricfreedom.org -- Where the Music Progressively Rocks!

"If you can find something everyone agrees on, it's wrong" - Mo Udall

Aha, I am understanding how it all works now.. Thanks for looking at
my post anyway, I am on to the CMS provider about the code...
 
N

Neredbojias

With neither quill nor qualm, smokeyd quothed:
"Using a pointed stick and pebbles, smokeyd scraped: "

could maybe have been put more politely and with less typing as:
'smokeyd wrote:'

"What the heck has the time of day to do with it? "

could maybe have been written have been written a bit more politely as
well?

What the heck has politeness got to do with solving a markup problem?
If polite responses are the only kind you can stomach, you are apt to be
bothered by "htmlatocis" for a long time.

(Furthermore, I thought I *was* being polite by not saying "hell"!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top