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.

Code Snippets / [DBP] - A simple 3D analog clock - No models needed.

Author
Message
jestermon
12
Years of Service
User Offline
Joined: 26th Nov 2010
Location:
Posted: 26th Nov 2011 13:36
A simple 3D analog clock - No models needed.
As I move more of my work to DBPro, I need to master the various idiosyncrasies of the engine. One of these is the apparent absence of rotations around a world-relative-reference. Most of the rotation syntax is dedicated to rotation around a local-axis-reference.
After fiddling a bit with the commands, the 'rotate object' works perfectly for a world reference, provided that the other axis are 'zeroed'.
Here is an analog clock that uses this approach in order to manage the hand rotations based on a world-relative-reference.
Since this is purely code, no models are needed.


Stab in the Dark software
Valued Member
19
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Nov 2011 16:46
Nicely Done.


[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
jestermon
12
Years of Service
User Offline
Joined: 26th Nov 2010
Location:
Posted: 26th Nov 2011 19:18
Thanks Stab...

One little bug I picked up after it was posted
The line

needs to be changed to

in order to get the correct number of larger 'ticks'
Cybermind
Valued Member
20
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 29th Nov 2011 21:30
Sweet clock

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...

Login to post a reply

Server time is: 2022-11-30 14:54:16
Your offset time is: 2022-11-30 14:54:16