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.

DarkBASIC Discussion / anyone know the maths to a clock

Author
Message
TrueDB
18
Years of Service
User Offline
Joined: 13th Nov 2007
Location:
Posted: 5th Dec 2007 01:59
anyone know the mathmatical equation that plats a hand of a clock?

MAIN PROGRAM http://www.thewargamer.com/grognard/avalompro.zip GAME MODULES http://www.thewargamer.com/grognard/avittybitty.zip http://www.thewargamer.com/grognard/avalamo.zip
Bluestar4
20
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 5th Dec 2007 07:36
there are 60 seconds in a minute , and 360 degrees in a circle.
therefore each second past 12 o'clock would be 6 degrees (360/60) farther in a clockwise direction, the same goes for the minute hand - for each minute it would be 6 degrees clockwise. as for the hour hand, it would be 1/2 degree clockwise per minute or 30 degrees clockwise per hour.

TrueDB
18
Years of Service
User Offline
Joined: 13th Nov 2007
Location:
Posted: 5th Dec 2007 19:08
Hi Bluestar4 , so in a DB how would you do it? Ive not played with degrees would it be something like line ,x+?,y+?,x+?,y2+?

MAIN PROGRAM http://www.thewargamer.com/grognard/avalompro.zip GAME MODULES http://www.thewargamer.com/grognard/avittybitty.zip http://www.thewargamer.com/grognard/avalamo.zip
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Dec 2007 19:57
@TrueDB

Check out the first challenge in the DBC challenges. Should give you some good ideas:

DBC Challenges

Enjoy your day.
TrueDB
18
Years of Service
User Offline
Joined: 13th Nov 2007
Location:
Posted: 6th Dec 2007 00:53
Thank Latch Ill have a look

MAIN PROGRAM http://www.thewargamer.com/grognard/avalompro.zip GAME MODULES http://www.thewargamer.com/grognard/avittybitty.zip http://www.thewargamer.com/grognard/avalamo.zip
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Dec 2007 09:12
sin and cos are your friends

"You must be someone's friend to make comments about them." - MySpace lied.
Bluestar4
20
Years of Service
User Offline
Joined: 19th Dec 2005
Location: USA
Posted: 6th Dec 2007 10:06
it actually depends on if your going to do it with lines in 2d or use 3d objects - if your using 2d it goes back to how to plot a single point of a cirlce , {keeping in mind however that 0 degrees is directly right or 3 o]clock position } if your using 3d objects it amounts to nothing more than creating the objects and rotating them.

TrueDB
18
Years of Service
User Offline
Joined: 13th Nov 2007
Location:
Posted: 6th Dec 2007 10:58
Ive been looking at the code snippets there great stuff! Im going to use lines and another 2 short lines like an arrow head.

MAIN PROGRAM http://www.thewargamer.com/grognard/avalompro.zip GAME MODULES http://www.thewargamer.com/grognard/avittybitty.zip http://www.thewargamer.com/grognard/avalamo.zip
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Dec 2007 00:14
making an arrow head is actually quite hard as you have to keep it pointing out from the centre as it goes round.

"You must be someone's friend to make comments about them." - MySpace lied.
TrueDB
18
Years of Service
User Offline
Joined: 13th Nov 2007
Location:
Posted: 7th Dec 2007 00:24
good point OBese87

MAIN PROGRAM http://www.thewargamer.com/grognard/avalompro.zip GAME MODULES http://www.thewargamer.com/grognard/avittybitty.zip http://www.thewargamer.com/grognard/avalamo.zip
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Dec 2007 15:16


Enjoy your day.
TrueDB
18
Years of Service
User Offline
Joined: 13th Nov 2007
Location:
Posted: 7th Dec 2007 17:38
WOW! latch thankyou! save me from going around looking for the right snippet of code thanks

MAIN PROGRAM http://www.thewargamer.com/grognard/avalompro.zip GAME MODULES http://www.thewargamer.com/grognard/avittybitty.zip http://www.thewargamer.com/grognard/avalamo.zip

Login to post a reply

Server time is: 2026-07-06 00:08:52
Your offset time is: 2026-07-06 00:08:52