things after a lot of time-consuming trail and error,
not knowing half of what I'm doing along the way. =)
* * *
I want to make a moon dial, like the ones used in
mechanical grandfather clocks and classy watches.
The moon dial simply a disk that turns 360 degrees
once a moon.
So...what I've learned thus far is that basically the moon
moves through its ecliptic thus:
360 degrees / 29.53 days = 12.19 degrees per day
Of course this is very general. There are variations...but
this would serve as a good starting point.
Now I'd like to use this bit of code I use
for clock hour hands...to rotate an object, in
this case a disk.
I worked out these numbers:
708.72 hours in a moon cycle
360 / 708.72 = 0.507958
And I'm wondering if I can use llGetWallclock base
to derive the rotation I need for the llEuler2Rot
calculation. There's probably a much better way.
This is what I use for some hour hands:
float now = llGetWallclock();
float minute = (integer)now / 60;
float hour = minute / 60;
// For 12 Hour Clock Hour Hand
rotation hand_rot = llEuler2Rot(<0, 30 * hour * DEG_TO_RAD, 0>
;llSetLocalRot(hand_rot);
* * *
And so now...
// For the Moon???????
rotation hand_rot = llEuler2Rot(<0, 0.507958 * hour?? * DEG_TO_RAD, 0>
;llSetLocalRot(hand_rot);
Any help would be grandly appreciated!!
--Infrared
ec) whereas your period, the length of time it'll take for your hand to rotate 360deg is 29.53 days. Therefore you'll need to include a date function and start from a specific date to give you a full period, this is best done using the llGetUnixTime function: