Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Game Time Varying

Author
Message
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 18th Dec 2008 08:05
I have two objects, one rotating around another whilst the other rotates in place. Plainly it's like a sun rotating around a planet. You can rotate the camera around the planet but what I need is to adjust the time based on the cameras position (which is constantly pointing at the objects location)

I know that a sawtooth function is needed. As there are 24 hours in a day, 60 minutes in an hour and 60 seconds in a minute. So for every 14 degrees, sixty minutes should pass, and 3600 seconds. How can I make an equation that can show this? I would know this type of math by heart if my math wasn't so lacking.

I should also say that the planet is only in appearance- rotating around the sun. In actuality, the sun is doing the rotation.

-Daryn

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 18th Dec 2008 08:08
I forgot to mention that rather than have the total seconds for each hour, it should be the total seconds for each minute. Obviously

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 18th Dec 2008 11:41
There are 60 sec per min.
and 60 min per hour, (60 * 60 = 3600 sec per hour)
and 24 hours per day (3600 * 24 = 86400 sec per day)
and 365.25 days per revolution of the earth around the sun. (86400 * 365.25 = 31557600 sec per year)

So then there are 31557600 / 360 sec in one degree, because that is how many degrees are in a complete revolution. So one degree of revolution of the earth about the sun is 87660 seconds.





Is that what you want?
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 18th Dec 2008 15:10
Your close. YOu nearly hit the nail on the head. How would I then create the clock which (only in appearance if needed) restarts its seconds ever 60 turns and likewise for minuetes?

That was very helpful though. Thank you

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 18th Dec 2008 16:35
Pardon the double post, but I am looking for HH:MM:SS format. I would use the clock function included in dbpro if it could be altered in a way to give you your in game time. But as it can't be fast forwarded and such I really need some sort of sawtooth equation. (See picture for reference)
A= Another smaller sawtooth equation for 60 seconds within each minute
B=60 minutes or 'the ceiling' of the equation
C= the total length of the equation (or 360 for the rotation of the planet)

If anyone can help it would be most appreciated. I would much prefer this type of time regulation as apposed to anything else unless you can sway me . Thank you though for the help in the matter.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Attachments

Login to view attachments
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 19th Dec 2008 15:59
Okay I understand now.

There is a slight bug with the INT(float) causing some anomalous output, however, it appears to work pretty well. maybe implement a rounding routine, but that just means more overhead. Your choice anyway, here is what I got.

Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 20th Dec 2008 07:05
I Bow to you pillarofire! wonderful. Now to conver this into what I need.


Where and by what means can I make this object above relate to the clock-code you provided. Since the angle (Ang#) is always a constant 360º at max and 0º at min, I suppose replacing the "A#" may work but I'm not sure. If you can point me in the right direction it would help... but it is also simple enough for me to figure out with some time. Thank you.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 20th Dec 2008 10:57
I got it. Just through in
and its all good. From this I can through in months, years, days and so fourth. Thank you all so much!

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 21st Dec 2008 10:33
Well I'm not sure exactly what you were trying to accomplish, but judging from you other posts I'm guessing that you will find this useful.

Login to post a reply

Server time is: 2024-11-24 17:06:54
Your offset time is: 2024-11-24 17:06:54